:root {
    /* Gold primary (was teal 194/20/49) — matches the hero accent #d99a3a */
    --bulma-primary-h: 36deg;
    --bulma-primary-s: 68%;
    --bulma-primary-l: 54%;
    --bulma-primary-invert-l: 14%; /* dark, readable text on the gold (else Bulma picks white) */

    --bulma-link-h: 0deg;
    --bulma-link-s: 0%;
    --bulma-link-l: 90%;

    --bulma-family-primary: "Instrument Sans", sans-serif;
    --bulma-family-secondary: "Instrument Sans", sans-serif;
    --bulma-body-family: "Instrument Sans", sans-serif;

    /* Body type target: ~16px → ~18px across small → large phones */
    --min-root: 100%;    /* ~16px baseline (respects user/browser settings) */
    --max-root: 112.5%;  /* ~18px upper bound */

    /* Comfortable reading settings */
    --body-line-height: 1.5;
}

html {
    font-size: clamp(var(--min-root), 96% + 0.8vw, var(--max-root)); /* ~16px -> 18px */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    line-height: var(--body-line-height);
    letter-spacing: normal;
    font-weight: 400;
}

/* Apply these rules to all links that are not of class "button" */
a:not(.button) {
    text-decoration: underline;
}

/* Remove underline on hover for all links that are not of class "button" */
a:not(.button):hover {
    text-decoration: none;
}

/* Ensure link color remains the same for visited and active states for all links that are not of class "button" */
a:not(.button):visited, a:not(.button):active {
    color: inherit;
}

/* Override the rules for any link that is a child of the <header><nav> structure */
.navbar-brand a, #novelcraftedNavbar a {
    text-decoration: none;
}

header nav a:not(.button):visited, header nav a:not(.button):active {
    color: inherit;
}

.aboreto-regular {
    font-family: "Aboreto", system-ui;
    font-style: normal;
    font-weight: 400;
    text-rendering: optimizeLegibility; /* display type only — avoid the global mobile-perf cost */
}

/* Explicit stacking order */
#main-hero { z-index: 0; }
.hero-container .hero-layer.back { z-index: 1; }
.hero-container .floaty { z-index: 2; }
.hero-container .hero-layer.front { z-index: 3; }
#hero-text { z-index: 4; }

#main-hero {
    position: relative;
    margin-bottom: clamp(5px, 0.5vh, 10px);
}

/* Container sets the visual height so following content never overlaps */
.hero-container {
    position: relative;
    /* At least 700px (hero background min-height), or 85vh if bigger.
        Don't let it shrink below this. Start clipping from here to preserve the image appearance */
    min-height: max(85vh, 700px); /* never shorter than the hero height */
    height: 100%;
    width: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.hero-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

img.hero-layer {
    object-fit: cover;              /* preserve aspect, fill, crop as needed */
    object-position: left top;      /* framing */
    display: block;                 /* remove inline whitespace gaps */
}

.hero-container .floaty {
    position: absolute;
    object-fit: none;
    object-position: center center;
    inset: auto;
    opacity: 0;

    /* Ellipse center — safe defaults; .homepage/.browse override per page */
    --cx: 50%;
    --cy: 50%;

    /* Radii (set ry slightly smaller than rx for a subtle ellipse) */
    --rx: 600px;            /* horizontal radius  */
    --ry: 220px;     /* vertical radius (make < rx for a slight ellipse) */

    /* Animation visuals */
    --duration: 4s;         /* loop time */

    --start-pct: 75%;
    --end-pct: 60%;
    /* For full lap, use 0% -> 100% in the keyframes */

    will-change: offset-distance, opacity; /* transform is static (rotate only) — not animated */

    /* Elliptical path centered at (--cx, --cy) */
    offset-path: ellipse(var(--rx) var(--ry) at var(--cx) var(--cy));

    /* Start/end along that path */
    offset-distance: var(--start-pct);

    /* Keep comet's own rotation independent of tangent */
    offset-rotate: 0deg;
    transform: rotate(var(--tilt));

    /* Same cadence as your original */
    animation: comet-ellipse-arc  var(--duration) linear infinite;

    filter: drop-shadow(0 0 6px rgba(255,255,255,.9))
    drop-shadow(0 0 14px rgba(255,255,255,.6));
}

/* Homepage floaty animations */
/* Partial circular arc (counter clockwise), auto-restarts with fade/reset */
.homepage .hero-container .floaty {
    /* Center of the ellipse  */
    --cx: 550px;
    --cy: 300px; /* 230-290 */

    /* --rx inherited from base .floaty (600px); only --ry differs here */
    --ry: 300px;     /* vertical radius (make < rx for a slight ellipse) */

    --tilt: -12deg;         /* sprite tilt */
}

/* Browse floaty animations */
.browse .hero-container .floaty {
    /* Center of the ellipse  */
    --cx: 800px;
    --cy: 675px;
    --start-pct: 80%;
    --ry: 600px;
    --tilt: -6deg;         /* sprite tilt */
}

/* Fade-in → run arc → fade-out → jump back invisible (like your original) */
@keyframes comet-ellipse-arc {
    0%   { opacity: 0; offset-distance: var(--start-pct); }
    4%   { opacity: 1; offset-distance: var(--start-pct); }
    88%  { opacity: 1; offset-distance: var(--end-pct); }
    96%  { opacity: 0; offset-distance: var(--end-pct); }
    100% { opacity: 0; offset-distance: var(--end-pct); }
}

/* Honor reduced-motion: stop the loop, release the compositor layer */
@media (prefers-reduced-motion: reduce) {
    .hero-container .floaty {
        animation: none;
        will-change: auto;
        opacity: 0;
    }
}


/* Hero Text styles -------------------------- */
/* Hero text overlay — shared by Homepage + Browse (identical markup)
   Type & buttons scale fluidly; sizes tuned to Aboreto's wide metrics so the
   headline holds two clean lines from ~320px up. */
#hero-text{
    position:absolute; inset:0;
    display:flex; flex-direction:column;
    align-items:center; justify-content:flex-start;
    text-align:center; white-space:normal;
    padding:clamp(2.25rem,7vh,6rem) 5vw 1.5rem;
    font-size:1rem;
    pointer-events:none;                 /* only the buttons catch clicks */
    background:radial-gradient(115% 78% at 50% 30%,
        rgba(20,17,28,.70) 0%, rgba(20,17,28,.50) 26%,
        rgba(20,17,28,.22) 46%, rgba(20,17,28,.04) 62%, transparent 74%);
}
#hero-text > span{ float:none; clear:none; margin:0; padding:0; }  /* reset inherited */
#hero-text > *{ pointer-events:auto; }

.hero-eyebrow{
    display:inline-flex; align-items:center; gap:.7em; white-space:nowrap;
    font-family:var(--bulma-family-primary);
    font-size:clamp(.66rem, .5rem + .55vw, .85rem);
    font-weight:700; letter-spacing:.26em; text-transform:uppercase;
    color:var(--bulma-primary);
    margin-bottom:clamp(.6rem,1.6vw,1.1rem);
    text-shadow:0 1px 12px rgba(10,8,16,.7);
}
.hero-eyebrow::before,.hero-eyebrow::after{content:"";width:clamp(14px,2.4vw,26px);height:1px;background:currentColor;opacity:.7}

.hero-title{
    font-family:"Aboreto",system-ui,serif; font-weight:400;
    font-size:clamp(0.95rem, 6vw, 4rem);
    text-rendering:optimizeLegibility; /* display type only */
    line-height:1.12; letter-spacing:0; color:#f4ecdc;
    margin:0 0 clamp(.7rem,1.8vw,1.1rem);
    text-shadow:0 2px 30px rgba(12,10,18,.7),0 1px 4px rgba(12,10,18,.5);
}
.hero-title .has-text-primary{color:var(--bulma-primary)!important}

.hero-sub{
    font-family:var(--bulma-family-primary);
    font-size:clamp(.95rem, .9rem + .45vw, 1.2rem);
    line-height:1.55; color:#f4ecdc;
    max-width:34rem; margin:0 auto clamp(1.1rem,2.4vw,1.6rem);
    text-shadow:0 1px 16px rgba(12,10,18,.85),0 1px 3px rgba(12,10,18,.7);
}

.hero-actions{
    display:flex; flex-wrap:wrap; justify-content:center;
    gap:clamp(.6rem,1.4vw,.85rem);
    width:100%; max-width:30rem;
}
.hero-actions .button{
    font-weight:700;
    font-size:clamp(.9rem, .85rem + .35vw, 1.05rem);
    height:auto; min-height:3em; padding:.8em 1.55em; border-radius:2px;
}
.hero-actions .button:not(.is-primary){           /* "Browse stories" reads over the art */
    background:rgba(20,17,28,.34); color:#f4ecdc; border-color:rgba(244,236,220,.55);
    backdrop-filter:blur(3px);
}
.hero-actions .button:not(.is-primary):hover{
    background:rgba(20,17,28,.5); border-color:var(--bulma-primary); color:var(--bulma-primary);
}
.hero-arrow{margin-left:.5em}

/* Scroll-down cue — bottom-center of the hero */
.hero-scroll{
    position:absolute; z-index:5; left:50%; bottom:clamp(14px,2.4vh,28px);
    transform:translateX(-50%);
    display:flex; flex-direction:column; align-items:center; gap:9px;
    font-family:var(--bulma-family-primary);
    font-size:.66rem; font-weight:700; letter-spacing:.28em; text-transform:uppercase;
    opacity:.95; pointer-events:none;
}
.hero-scroll__label{
    padding:.4em .85em; border-radius:999px;
    background:rgba(20,17,28,.5);
    -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
    color:#f4ecdc; text-shadow:0 1px 4px rgba(10,8,16,.55);
}
.hero-scroll__line{
    width:1px; height:34px; position:relative; overflow:hidden;
    background:linear-gradient(rgba(20,17,28,.6), rgba(20,17,28,0));
}
.hero-scroll__line::after{
    content:""; position:absolute; left:0; top:-34px; width:1px; height:34px;
    background:var(--bulma-primary);
    animation:hero-scroll-drop 2.2s cubic-bezier(.6,0,.2,1) infinite;
}
@keyframes hero-scroll-drop{ 0%{top:-34px} 60%,100%{top:34px} }
@media (prefers-reduced-motion: reduce){ .hero-scroll__line::after{ animation:none } }

.image img.cover-art {
    max-width: 320px;
}

@media screen and (max-width: 768px) {
    /* Hero overlay (Homepage + Browse) --- */
    #hero-text{ padding:clamp(2rem,8vh,4.5rem) 5vw 1.25rem; }

    .image img.cover-art {
        max-width: 100%;
    }
}

/* Hero — small phones: simplify the eyebrow, stack the buttons */
@media screen and (max-width: 520px) {
    .hero-eyebrow{ letter-spacing:.2em; }
    .hero-eyebrow::before,.hero-eyebrow::after{ display:none; }
}
@media screen and (max-width: 480px) {
/* Small phones: bold + a touch larger headline for readability.
       Aboreto ships 400 only — the browser faux-bolds it, which reads cleanly here.
       6.7vw is capped right at the point where it still holds two lines. */
    .hero-title{ font-weight:700; font-size:clamp(1.05rem, 6.7vw, 1.85rem); }
    .hero-actions{ flex-direction:column; align-items:stretch; max-width:17rem; }
    .hero-actions .button{ width:100%; }
    .hero-eyebrow{ display:none; }   /* phones: drop the eyebrow entirely */
}

/* End Hero Text styles -------------------------- */



/* Browse pages */
.rating {
    /* Controls */
    --stars: 5;
    --rating: 4;          /* set per instance, e.g., style="--rating: 3.75" */
    --size: 1.25rem;
    --star-color: #f5c518; /* filled */
    --star-bg: #e5e7eb;    /* empty */

    position: relative;
    display: inline-grid;
    /* 5 equal columns ensures identical star slots for both layers */
    grid-template-columns: repeat(var(--stars), 1fr);
    line-height: 1; /* stable vertical metrics */
}

/* Both layers use the exact same grid so icons line up pixel-for-pixel */
.rating__base,
.rating__fill {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: inherit;
    align-items: center;
}

/* Prevent gaps/whitespace between icons inside each layer */
.rating__base i,
.rating__fill i {
    font-size: var(--size);
    line-height: 1;
    /* fa-fw gives consistent width; no extra margins needed */
}

/* Colors */
.rating__base i { color: var(--star-bg); }
.rating__fill i { color: var(--star-color); }

/* Gold layer overlays and is clipped to fractional width */
.rating__fill {
    position: absolute;
    inset: 0;
    width: calc((var(--rating) / var(--stars)) * 100%);
    overflow: hidden;
    pointer-events: none;
}

/* Browse latest: story tile grid ---------------------------------
   Design: docs/design/browse-latest-cover-options.html (option A3).
   Each story is a panel: a 2:3 cover, then title, author, rating and
   play time, then price and buttons pinned to the bottom so they line
   up across a row. */
.browse .listing-head{ margin-bottom:1.75rem; }
.browse .listing-head h1{
    font-family:"Aboreto", serif; font-size:clamp(1.3rem, 1rem + 1vw, 1.8rem);
    line-height:1.2; color:#f4ecdc;
}
.story-grid{
    --lamp:#d99a3a;
    --foil:#e7b94d;
    --parchment:#f4ecdc;
    display:grid; gap:1.5rem;
    /* At most 4 per row, never narrower than 175px, so smaller screens drop to 3 or 2. */
    grid-template-columns:repeat(auto-fill, minmax(max(175px, calc((100% - 3 * 1.5rem) / 4)), 1fr));
}
@media (max-width:560px){ .story-grid{ grid-template-columns:repeat(2, 1fr); gap:.75rem; } }

.story-tile{
    container-type:inline-size;
    display:flex; flex-direction:column; min-width:0;
    padding:.75rem .75rem .8rem;
    background:#1b1d22; border:1px solid rgba(255,255,255,.06); border-radius:10px;
}
@media (prefers-reduced-motion: no-preference){ .story-tile{ transition:border-color .2s ease; } }
.story-tile:hover, .story-tile:focus-within{ border-color:rgba(217,154,58,.38); }

/* Book frame: uploaded art and placeholders share the same 2:3 frame and spine shading */
.story-tile .cover-wrap{ position:relative; }
.story-tile .bookface{
    display:block; position:relative; width:100%;
    container-type:inline-size;
    aspect-ratio:2/3; overflow:hidden;
    border-radius:3px 6px 6px 3px;
    background:#0c0c0a;
    box-shadow:0 1px 1px rgba(0,0,0,.45), 0 8px 16px -8px rgba(0,0,0,.8);
    text-decoration:none;
}
.story-tile .bookface::after{
    content:""; position:absolute; inset:0; pointer-events:none; border-radius:inherit;
    background:linear-gradient(90deg,
        rgba(0,0,0,.40) 0, rgba(0,0,0,.08) 4%,
        rgba(255,255,255,.16) 5.2%, rgba(255,255,255,0) 8.5%,
        transparent 93%, rgba(0,0,0,.14) 100%);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.07);
}
.story-tile a:focus-visible{ outline:2px solid var(--lamp); outline-offset:3px; }

/* Uploaded cover: any shape fits. The image shows whole and a blurred copy fills the rest. */
.story-tile .upload{ position:absolute; inset:0; display:block; overflow:hidden; }
.story-tile .upload-bg{
    position:absolute; inset:-12%; width:124%; height:124%; max-width:none; object-fit:cover;
    filter:blur(16px) brightness(.55) saturate(1.2);
}
.story-tile .upload-img{ position:relative; display:block; width:100%; height:100%; object-fit:contain; }

/* No cover: lamp-lit placeholder with an icon and the title */
.story-tile .lamp-ph{
    position:absolute; inset:0;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:6cqw; padding:12cqw 10cqw 26cqw;
    background:
        radial-gradient(70% 45% at 50% 30%, rgba(231,185,77,.30), rgba(231,185,77,.06) 60%, transparent 75%),
        linear-gradient(#22220f, #12120b);
}
.story-tile .lamp-ph::before{   /* lamp chain */
    content:""; position:absolute; top:0; left:50%; width:1px; height:14%;
    background:rgba(231,185,77,.35);
}
.story-tile .lamp-ph i{ font-size:22cqw; color:var(--foil); filter:drop-shadow(0 0 10px rgba(231,185,77,.45)); }
.story-tile .lamp-ph .ph-title{
    font-family:"Aboreto", serif; font-size:10.5cqw; line-height:1.2; text-align:center;
    color:rgba(244,236,220,.82); overflow-wrap:break-word;
    display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden;
}
.story-tile .lamp-ph.is-long .ph-title{ font-size:8.5cqw; }

/* Sample button on the cover's bottom-right corner */
.story-tile .sample-pill{
    position:absolute; right:.45rem; bottom:.45rem; z-index:2;
    display:inline-flex; align-items:center; gap:.35rem;
    min-height:1.9rem; padding:.15rem .7rem .15rem .55rem; border-radius:999px;
    font-size:.74rem; letter-spacing:.01em; font-weight:600;
    color:var(--parchment); text-decoration:none;
    background:#15150f; border:1px solid rgba(231,185,77,.6);
    box-shadow:0 2px 10px rgba(0,0,0,.65);
}
.story-tile .sample-pill i{ font-size:.7rem; color:var(--foil); }
.story-tile .sample-pill:hover{ border-color:var(--lamp); color:var(--parchment); }
.story-tile .sample-pill:focus-visible{ outline-offset:2px; }
/* Darkens only the art around the Sample button so cover text behind it does not clash */
.story-tile .pill-shade{
    position:absolute; inset:0; z-index:1; pointer-events:none; border-radius:3px 6px 6px 3px;
    background:radial-gradient(90% 30% at 100% 100%, rgba(8,8,6,.82), rgba(8,8,6,.5) 45%, rgba(8,8,6,0) 78%);
}

/* About the book */
.story-tile .about{ padding-top:.8rem; margin-bottom:.8rem; }
.story-tile h3{ font-size:1rem; font-weight:600; line-height:1.3; color:var(--parchment); }
.story-tile h3 a, .story-tile .by a{ color:inherit; text-decoration:none; }
.story-tile h3 a:hover, .story-tile .by a:hover{ text-decoration:underline; }
.story-tile .clamp-2{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.story-tile .by{
    font-size:.85rem; line-height:1.35; margin-top:.15rem; opacity:.7;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.story-tile .rate{ display:flex; align-items:center; gap:.4rem; min-height:1.4rem; margin-top:.45rem; font-size:.82rem; }
.story-tile .rate .rating{ --size:.78rem; flex:none; }
.story-tile .rate .count{ opacity:.6; }

/* Price and buttons, pinned to the bottom of the panel */
.story-tile .buy{ margin-top:auto; padding-top:.7rem; border-top:1px solid rgba(255,255,255,.07); }
.story-tile .cost{ font-size:1.05rem; font-weight:700; line-height:1.2; color:var(--parchment); font-variant-numeric:tabular-nums; }
.story-tile .cost .cur{ font-size:.72rem; font-weight:500; opacity:.6; margin-left:.25rem; letter-spacing:.02em; }
.story-tile .tile-actions{ display:flex; flex-direction:column; gap:.4rem; margin:.6rem 0 0; }
.story-tile .tile-actions .button{
    width:100%; margin:0; padding-inline:.6em;
    height:auto; min-height:2.5rem;           /* 40px tap target */
    font-size:.85rem; font-weight:600; white-space:nowrap;
}
.story-tile .tile-actions .button.is-owned{
    background:rgba(72,199,142,.12); color:#7fe0b0; border-color:rgba(72,199,142,.5);
}
@container (max-width: 185px){
    .story-tile .tile-actions .button .icon{ display:none; }   /* narrow phone tiles: text only */
}

/* Author invite after the last story */
.story-tile.is-invite{ background:rgba(217,154,58,.04); border:1.5px dashed rgba(231,185,77,.4); justify-content:center; }
.story-tile .invite{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.6rem;
    text-align:center; padding:1rem; color:var(--parchment);
}
.story-tile .invite i{ color:var(--foil); font-size:1.5rem; }
.story-tile .invite strong{ color:var(--parchment); font-weight:600; }
.story-tile .invite p{ font-size:.85rem; opacity:.8; max-width:22ch; }

@media (max-width:560px){
    .story-tile{ padding:.55rem .55rem .65rem; border-radius:8px; }
    .story-tile .about{ padding-top:.65rem; margin-bottom:.65rem; }
    .story-tile h3{ font-size:.95rem; }
}


.media.author-response {
    border-top: 0;
    border-inline-start: 2px solid var(--bulma-border);
    margin: 1.25rem 0 0 1rem;
    padding: 0 0 0 1rem;
}

.author-response-heading {
    gap: 0.5rem;
}

@media screen and (max-width: 768px) {
    .media.author-response {
        margin-inline-start: 0.25rem;
        padding-inline-start: 0.75rem;
    }
}

/* Reading. The one column on the play pages and the preview page. It is
   set in rem, the same unit as the story text size, so the two grow
   together and a line holds about 65 to 75 characters of story text. The
   story text, notes, and question fill this column (see "One column"
   below), so everything shares one left edge and one right edge. */
.text-container {
    max-width: 35rem;
    margin-left: auto;
    margin-right: auto;
}

.text-container a:link.disabled,
.text-container a.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

/*
 * Reading screens: the author play page, the player play page, the
 * preview page, and the side reader on the graph page (author.css,
 * .graph-reader). They share the colors, the loading spinner, the fade
 * in, the Back and Next buttons, and the choice cards below.
 *
 * Colors. Each one has one meaning on the graph page (author.css):
 *   amber   "you are here", and the loading spinner
 *   blue    "where this choice goes"
 *   teal    the lit path
 *   purple  locks and alternate text
 */
:root {
    --reader-ink: #1f2933;
    --reader-ink-strong: #17212b;
    --reader-ink-weak: #5f6b78;
    --reader-rule: #e3e6ea;
    --reader-control-border: #d5dae0;
    --reader-path: #0E7C86;
    --reader-path-deep: #0A5960;
    --reader-path-tint: #E3F5F5;
    --reader-gain: #1F7A3A;
    --reader-gain-bg: #E6F4EA;
    --reader-loss: #B42318;
    --reader-loss-bg: #FDECEA;
    --reader-here: #FFBF00;
    --reader-here-deep: #8A6700;
    --reader-here-tint: #FFF6D6;
    --reader-preview: #1D4ED8;
    --reader-preview-tint: #EEF3FE;
    --reader-alt: #5B2263;
    --reader-alt-tint: #F4EAF6;
    --reader-ach: #157A3B;
    --reader-ach-tint: #E6F4EA;
    --reader-serif: "Source Serif 4", Georgia, serif;
    --reader-card-bg: #fff;
    --reader-card-border: #d9dee4;
    --reader-card-hover-bg: #f6f8fa;
    --reader-num-bg: #eef1f4;
    --reader-prose: #222c36;
    /* The bar of a pull quote: the site's gold */
    --reader-quote: hsl(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l));
    --reader-panel-bg: #f5f6f8;
    --reader-warn: #8A6700;
    --reader-timer-track: #eceff2;
    --reader-lock-bg: #fbfafc;
    --reader-lock-stripe: rgba(91, 34, 99, 0.07);
    --reader-lock-border: #e2dbe5;
    --reader-lock-ring: rgba(91, 34, 99, 0.25);
}

/* Loading (ui/reading-busy). While a .reading-stage has
   aria-busy="true", everything in it is hidden and the spinner shows in
   its place. When aria-busy goes back to "false", the content fades in,
   all at once. Hidden content can not be clicked or focused, so nothing
   can be picked twice. */
.reading-stage[aria-busy="true"] > :not(.reading-loading) {
    display: none;
}

.reading-stage > :not(.reading-loading) {
    animation: reading-fade-in 180ms ease-out;
}

.reading-loading {
    display: none;
}

.reading-stage[aria-busy="true"] > .reading-loading {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    min-height: 12rem;
    font-size: 0.875rem;
    color: var(--reader-ink-weak);
    /* The spinner shows only after a short wait, so a fast load does not
       flash it */
    animation: reading-fade-in 160ms ease-out 120ms both;
}

.reading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--reader-here-tint);
    border-top-color: var(--reader-here);
    border-radius: 50%;
    animation: reading-spin 800ms linear infinite;
}

@keyframes reading-fade-in {
    from {
        opacity: 0;
    }
}

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

@keyframes reading-pulse {
    50% {
        opacity: 0.35;
    }
}

/* Back and Next. Back on the left, Next on the right. Each side is as
   wide as its content when there is room. When there is not, the two
   columns share the width evenly, and a long title is cut with "...". */
.reading-nav {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, auto);
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.reading-nav-side {
    display: flex;
    min-width: 0;
}

.reading-nav-side.is-right {
    justify-content: flex-end;
}

.reading-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    max-width: 100%;
    min-height: 3.125rem;
    padding: 0.4375rem 0.875rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    text-align: left;
    color: var(--reader-ink);
    background-color: #fff;
    border: 1px solid var(--reader-control-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 120ms ease-out, border-color 120ms ease-out;
}

.reading-nav-btn > i {
    flex: none;
    font-size: 0.8125rem;
    color: var(--reader-ink-weak);
}

.reading-nav-btn:hover {
    background-color: #f5f7f9;
    border-color: #b8c0c9;
}

.reading-nav-btn:focus-visible {
    outline: 2px solid var(--reader-path);
    outline-offset: 2px;
}

/* A button with nowhere to go is not shown. Its place is kept, so the
   other button does not move. */
.reading-nav-btn:disabled {
    visibility: hidden;
}

.reading-nav-stack {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.reading-nav-cap {
    overflow: hidden;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--reader-ink-weak);
}

.reading-nav-title {
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Next: the one solid button */
.reading-nav-btn.is-next {
    color: #fff;
    background-color: #2b3a47;
    border-color: #2b3a47;
}

.reading-nav-btn.is-next:hover {
    background-color: #1f2b35;
    border-color: #1f2b35;
}

.reading-nav-btn.is-next > i,
.reading-nav-btn.is-next .reading-nav-cap {
    color: #b9c6d2;
}

/* Choice cards (components/reading-choices). The same on every reading
   screen. The ol and li rules name the element, so they win over the
   Bulma .content list rules on the play pages. */
.reading-stage p.reading-question {
    max-width: 65ch;
    margin: 1.5rem 0 0.75rem;
    font-family: var(--reader-serif);
    font-size: 1.0625rem;
    font-style: italic;
    font-weight: 600;
    color: var(--reader-ink-strong);
}

.reading-stage ol.reading-choices {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    scroll-margin-top: 1rem;
}

.reading-stage ol.reading-choices > li {
    margin: 0;
}

.reading-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.3125rem 0.75rem;
    width: 100%;
    margin: 0 0 0.5rem;
    padding: 0.75rem 0.875rem;
    font-family: inherit;
    text-align: left;
    color: var(--reader-ink);
    background-color: var(--reader-card-bg);
    border: 1px solid var(--reader-card-border);
    border-left: 3px solid var(--reader-card-border);
    border-radius: 8px;
}

button.reading-choice {
    cursor: pointer;
}

/* Pointed-at card: a blue outline and number. On the graph page it is
   the same blue as the target on the graph. */
button.reading-choice:not(:disabled):hover {
    background-color: var(--reader-card-hover-bg);
    outline: 2px solid var(--reader-preview);
    outline-offset: -1px;
}

button.reading-choice:focus-visible {
    outline: 2px solid var(--reader-path);
    outline-offset: 2px;
}

/* A choice was pressed and the next story node is loading */
button.reading-choice:disabled {
    cursor: default;
    opacity: 0.6;
}

.reading-choice.is-locked {
    border-left-color: var(--reader-alt);
}

/* A locked choice on a play page (a div: it can not be pressed). Faint
   diagonal stripes across the card, muted text, and a lock in the circle
   in place of the number (components/reading-choices). The graph page's
   locked cards are buttons the author can still press, so they keep the
   plain look. */
div.reading-choice.is-locked {
    cursor: not-allowed;
    background-color: var(--reader-lock-bg);
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0,
        transparent 7px,
        var(--reader-lock-stripe) 7px,
        var(--reader-lock-stripe) 8px
    );
    border-color: var(--reader-lock-border);
    border-left-color: var(--reader-alt);
}

div.reading-choice.is-locked .reading-choice-text {
    color: var(--reader-ink-weak);
}

div.reading-choice.is-locked .reading-choice-num {
    font-size: 0.6875rem;
    color: var(--reader-alt);
    background-color: var(--reader-alt-tint);
    box-shadow: inset 0 0 0 1px var(--reader-lock-ring);
}

/* Looking back: the picked card stands out, the others fade */
.reading-choice.is-chosen {
    border-left-color: var(--reader-path);
}

.reading-choice.is-passed {
    opacity: 0.6;
}

.reading-choice.is-passed .reading-choice-text {
    text-decoration: line-through;
}

.reading-choice-num {
    grid-row: span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    margin-top: 0.0625rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--reader-ink);
    background-color: var(--reader-num-bg);
    border-radius: 50%;
}

.reading-choice.is-chosen .reading-choice-num {
    color: #fff;
    background-color: var(--reader-path);
}

button.reading-choice:not(:disabled):hover .reading-choice-num {
    color: #fff;
    background-color: var(--reader-preview);
}

.reading-choice-text {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
}

.reading-choice-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3125rem 0.5rem;
    font-size: 0.75rem;
    color: var(--reader-ink-weak);
}

/* Small badges under the choice text */
.reading-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.6;
    border-radius: 4px;
}

.reading-badge.is-lock {
    color: var(--reader-alt);
    background-color: var(--reader-alt-tint);
}

.reading-badge.is-path,
.reading-badge.is-chosen {
    color: #fff;
    background-color: var(--reader-path);
}

/* Story variable changes: authors only */
.reading-badge.is-gain {
    color: var(--reader-gain);
    background-color: var(--reader-gain-bg);
}

.reading-badge.is-loss {
    color: var(--reader-loss);
    background-color: var(--reader-loss-bg);
}

/* Story node title and story text. The same serif type as the side
   reader on the graph page (author.css, .reader-title and
   .reader-prose). The h3 rules name the element, so they win over the
   Bulma .content heading rules on the play pages. */
.reading-stage h3.reading-title {
    margin: 0 0 1.25rem;
    font-family: var(--reader-serif);
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.005em;
    color: var(--reader-ink-strong);
}

.reading-stage .reading-prose,
.reading-stage .xray-other-text {
    max-width: 65ch;
    font-family: var(--reader-serif);
    font-size: 1.0625rem;
    font-optical-sizing: auto;
    line-height: 1.65;
    color: var(--reader-prose);
    hanging-punctuation: first;
}

/* The story text itself: paragraphs, line breaks, text styles, the
   image, and pull quotes. One set of rules for every place that shows
   it, so they all match:
     .reading-prose             the play and preview pages
     .xray-other-text           the text that is not showing, on the
                                author play page
     .rx-prose-wrap .ql-editor  the editor in the graph page's side
                                reader (components/rich-text)
   author.css adds only what differs in the editor: its box, and the
   color of the pull quote bar on the Alternate tab. */
.reading-stage :is(.reading-prose, .xray-other-text, .rx-prose-wrap .ql-editor) p {
    margin: 0 0 0.9em;
}

.reading-stage :is(.reading-prose, .xray-other-text, .rx-prose-wrap .ql-editor) > :last-child {
    margin-bottom: 0;
}

/* The image: its own block, centered, never wider than the text, and
   at its own size when it is smaller */
.reading-stage :is(.reading-prose, .xray-other-text, .rx-prose-wrap .ql-editor) figure {
    display: block;
    margin: 0.75rem 0 1.25em;
    padding: 0;
    line-height: 0;
}

.reading-stage :is(.reading-prose, .xray-other-text, .rx-prose-wrap .ql-editor) figure img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 4px;
}

/* A pull quote: a bar on the left, and text a little larger */
.reading-stage :is(.reading-prose, .xray-other-text, .rx-prose-wrap .ql-editor) blockquote {
    margin: 0 0 0.9em;
    padding: 0.25rem 0 0.25rem 1rem;
    font-size: 1.125em;
    line-height: 1.5;
    color: var(--reader-ink-strong);
    background: none;
    border-left: 3px solid var(--reader-quote);
}

.reading-stage :is(.reading-prose, .xray-other-text, .rx-prose-wrap .ql-editor) :is(u, s) {
    text-decoration-thickness: from-font;
}

/* Subscript and superscript don't push the lines apart */
.reading-stage :is(.reading-prose, .xray-other-text, .rx-prose-wrap .ql-editor) :is(sub, sup) {
    line-height: 0;
}

.reading-stage .reading-prose strong,
.reading-stage .reading-prose em {
    color: inherit;
}

/* Notes above the story text: what the last choice changed, and a new
   achievement. An icon on the left, then the words. */
.reading-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 65ch;
    margin: 0 0 1.25rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--reader-ink);
    background-color: var(--reader-panel-bg);
    border-radius: 8px;
}

.reading-note > i {
    flex: none;
    margin-top: 0.1875rem;
    color: var(--reader-ink-weak);
}

.reading-stage .reading-note p {
    margin: 0;
}

.reading-note-label {
    font-weight: 700;
    color: inherit;
}

.reading-stage .reading-note .reading-note-label {
    color: inherit;
}

.reading-note.is-achievement {
    color: var(--reader-ach);
    background-color: var(--reader-ach-tint);
}

.reading-note.is-achievement > i {
    color: inherit;
}

/* One column (the play pages and the preview page). The 65ch limits
   above are for the side reader on the graph page. Here the column
   (.text-container) sets the width, so the story text, notes, and
   question line up with the choice cards and with Back and Next. These
   rules come after the ones they change and have the same weight, so
   they win. */
.text-container .reading-prose,
.text-container .xray-other-text,
.text-container .reading-note,
.text-container p.reading-question {
    max-width: none;
}

/* Timer: a thin amber bar that runs down until the reader picks */
.reading-timer {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0.5rem 0 0;
    color: var(--reader-warn);
}

.reading-timer > i {
    flex: none;
    font-size: 0.875rem;
}

progress.reading-timer-bar {
    flex: 1 1 auto;
    width: 100%;
    height: 0.375rem;
    overflow: hidden;
    color: var(--reader-here);
    background-color: var(--reader-timer-track);
    border: 0;
    border-radius: 999px;
    -webkit-appearance: none;
    appearance: none;
}

progress.reading-timer-bar::-webkit-progress-bar {
    background-color: var(--reader-timer-track);
    border-radius: 999px;
}

progress.reading-timer-bar::-webkit-progress-value {
    background-color: var(--reader-here);
    border-radius: 999px;
}

progress.reading-timer-bar::-moz-progress-bar {
    background-color: var(--reader-here);
    border-radius: 999px;
}

/* "Your decision will have consequences", under the choice cards */
.reading-stage p.reading-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--reader-warn);
}

/* "See your choices": shows the question and choices
   (components/gameplay-choices-expander). It marks the place where the
   story splits: a line on each side and a solid pill in the middle. The
   pill uses the same colors as Next. The amber disc is "you are here".
   The whole row can be clicked. */
.reading-continue {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    margin: 2rem 0 0;
    padding: 0;
    font-family: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

.reading-continue::before,
.reading-continue::after {
    content: "";
    flex: 1 1 0;
    min-width: 1rem;
    height: 1px;
    background-color: var(--reader-control-border);
}

.reading-continue-pill {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0.375rem 0.4375rem 0.375rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    background-color: #2b3a47;
    border-radius: 999px;
    transition: background-color 120ms ease-out;
}

.reading-continue-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    font-size: 0.8125rem;
    color: #17212b;
    background-color: var(--reader-here);
    border-radius: 50%;
    transition: transform 160ms ease-out;
}

.reading-continue:hover .reading-continue-pill {
    background-color: #1f2b35;
}

/* The arrows move down a little, toward the choices */
.reading-continue:hover .reading-continue-icon {
    transform: translateY(2px);
}

.reading-continue:focus-visible {
    outline: none;
}

.reading-continue:focus-visible .reading-continue-pill {
    outline: 2px solid var(--reader-path);
    outline-offset: 3px;
}

/* End of a path, end of a preview, and the free preview limit
   (components/gameplay-story-end, preview-story-end,
   preview-complete-message) */
.reading-stage .reading-end {
    margin: 3rem 0 0;
    padding: 1.5rem 1.5rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--reader-ink);
    background-color: var(--reader-panel-bg);
    border-radius: 12px;
}

.reading-stage .reading-end:first-child {
    margin-top: 0;
}

.reading-stage h3.reading-end-title {
    display: flex;
    align-items: baseline;
    gap: 0.625rem;
    margin: 0 0 0.875rem;
    font-family: var(--reader-serif);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--reader-ink-strong);
}

.reading-end-title > i {
    flex: none;
    font-size: 1rem;
    color: var(--reader-ink-weak);
}

.reading-stage .reading-end p {
    max-width: 62ch;
    margin: 0 0 0.75rem;
}

.reading-stage .reading-end a:not(.reading-action) {
    font-weight: 600;
    color: var(--reader-ink-strong);
    text-underline-offset: 3px;
}

.reading-stage .reading-end ul.reading-end-list {
    margin: 0 0 0.875rem 1.25rem;
    list-style: disc;
}

.reading-stage .reading-end ul.reading-end-list li {
    margin: 0 0 0.125rem;
}

.reading-end-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 1rem;
}

.reading-stage .reading-end p.reading-end-more {
    margin: 0;
    font-size: 0.875rem;
    color: var(--reader-ink-weak);
}

/* End screen buttons: the same shape as Back and Next. The main one is
   solid, like Next. */
.reading-stage a.reading-action,
.reading-stage a.reading-action:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    min-height: 2.75rem;
    padding: 0.4375rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    color: var(--reader-ink);
    background-color: #fff;
    border: 1px solid var(--reader-control-border);
    border-radius: 10px;
    transition: background-color 120ms ease-out, border-color 120ms ease-out;
}

.reading-stage a.reading-action > i {
    flex: none;
    font-size: 0.8125rem;
    color: var(--reader-ink-weak);
}

.reading-stage a.reading-action:hover {
    background-color: #f5f7f9;
    border-color: #b8c0c9;
}

.reading-stage a.reading-action.is-primary,
.reading-stage a.reading-action.is-primary:visited {
    color: #fff;
    background-color: #2b3a47;
    border-color: #2b3a47;
}

.reading-stage a.reading-action.is-primary:hover {
    background-color: #1f2b35;
    border-color: #1f2b35;
}

.reading-stage a.reading-action.is-primary > i {
    color: #b9c6d2;
}

.reading-stage a.reading-action:focus-visible {
    outline: 2px solid var(--reader-path);
    outline-offset: 2px;
}

/* The story did not load (components/preview-error) */
.reading-stage .reading-error {
    padding: 1rem 1.125rem;
    font-size: 0.9375rem;
    color: var(--reader-ink);
    background-color: var(--reader-loss-bg);
    border-left: 3px solid var(--reader-loss);
    border-radius: 8px;
}

.reading-stage .reading-error h2.title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--reader-loss);
}

.reading-stage .reading-error p {
    margin: 0;
}

/* Dark pages (the player play page and the preview page). The author
   pages are light. Back is an outline and Next is the one solid button,
   the same as on light pages. */
[data-theme="dark"] .reading-stage {
    --reader-ink: #e6e9ed;
    --reader-ink-strong: #f3f5f7;
    --reader-ink-weak: #9aa5b1;
    --reader-control-border: #46505b;
    --reader-card-bg: transparent;
    --reader-card-border: #46505b;
    --reader-card-hover-bg: rgba(255, 255, 255, 0.06);
    --reader-num-bg: rgba(255, 255, 255, 0.1);
    --reader-preview: #6b8ff0;
    --reader-here-tint: rgba(255, 191, 0, 0.2);
    --reader-prose: #d5dbe1;
    /* A lighter gold, so the pull quote bar stands out on the dark page */
    --reader-quote: #f2c14e;
    --reader-panel-bg: rgba(255, 255, 255, 0.05);
    --reader-warn: #f2c14e;
    --reader-timer-track: rgba(255, 255, 255, 0.12);
    --reader-ach: #74d69a;
    --reader-ach-tint: rgba(31, 122, 58, 0.22);
    --reader-loss: #ff8a7f;
    --reader-loss-bg: rgba(180, 35, 24, 0.18);
    --reader-lock-bg: rgba(91, 34, 99, 0.08);
    --reader-lock-stripe: rgba(214, 166, 222, 0.08);
    --reader-lock-border: #4a3f4f;
    --reader-lock-ring: rgba(214, 166, 222, 0.5);
}

/* Back is an outline on the dark page, so it has no white fill */
[data-theme="dark"] .reading-nav-btn {
    background-color: transparent;
}

/* The pill is light on the dark page, the same as Next */
[data-theme="dark"] .reading-continue-pill {
    color: #17212b;
    background-color: #e6e9ed;
}

[data-theme="dark"] .reading-continue:hover .reading-continue-pill {
    background-color: #fff;
}

/* Images in the story text are a little dimmer on the dark page, so a
   bright picture does not glare. Pointing at one shows it at full
   brightness. */
[data-theme="dark"] .reading-stage :is(.reading-prose, .xray-other-text) img {
    filter: brightness(0.9);
    transition: filter 0.2s;
}

[data-theme="dark"] .reading-stage :is(.reading-prose, .xray-other-text) img:hover {
    filter: none;
}

@media (prefers-reduced-motion: reduce) {
    [data-theme="dark"] .reading-stage :is(.reading-prose, .xray-other-text) img {
        transition: none;
    }
}

[data-theme="dark"] .reading-stage a.reading-action,
[data-theme="dark"] .reading-stage a.reading-action:visited {
    background-color: transparent;
}

[data-theme="dark"] .reading-stage a.reading-action:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: #66717d;
}

[data-theme="dark"] .reading-stage a.reading-action.is-primary,
[data-theme="dark"] .reading-stage a.reading-action.is-primary:visited {
    color: #17212b;
    background-color: #e6e9ed;
    border-color: #e6e9ed;
}

[data-theme="dark"] .reading-stage a.reading-action.is-primary:hover {
    background-color: #fff;
    border-color: #fff;
}

[data-theme="dark"] .reading-stage a.reading-action.is-primary > i {
    color: #5f6b78;
}

[data-theme="dark"] .reading-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: #66717d;
}

[data-theme="dark"] .reading-nav-btn.is-next {
    color: #17212b;
    background-color: #e6e9ed;
    border-color: #e6e9ed;
}

[data-theme="dark"] .reading-nav-btn.is-next:hover {
    background-color: #fff;
    border-color: #fff;
}

[data-theme="dark"] .reading-nav-btn.is-next > i {
    color: #5f6b78;
}

/* Less motion: no fades, and the spinner pulses slowly in place */
@media (prefers-reduced-motion: reduce) {
    .reading-stage > :not(.reading-loading),
    .reading-stage[aria-busy="true"] > .reading-loading {
        animation: none;
    }

    .reading-spinner {
        border-color: var(--reader-here);
        animation: reading-pulse 1.6s ease-in-out infinite;
    }

    .reading-nav-btn,
    .reading-continue-pill,
    .reading-continue-icon,
    .reading-stage a.reading-action {
        transition: none;
    }
}

.award {
    color: #FFC72C;
}

.rating input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.rating label {
    position: relative;
    padding: 0 0.25rem;
}

.rating label:has(~ label > input:checked),
.rating label:has(input:checked) {
    color: #FFC72C;
}

.rating label:has(~ label > input:hover),
.rating label:has(input:hover) {
    color: #FFC72C;
}

.rating label:has(input:active) {
    color: #C89400
}

/* Honeypot fields are hidden via Bulma's .is-sr-only utility in the view */

#paypal-button-container {
    position: relative;
    z-index: 2;
}

/* Our modals put a Bulma .modal-card inside .modal-content. Bulma gives
   both a side margin and a 100% width on phones, so the card was pushed
   off the right edge. The inner card now fills the outer box, and on
   phones the outer box is narrowed to leave Bulma's side gap. The card
   also uses the outer box's max height, so a long card body scrolls and
   the footer buttons stay in view. */
.modal-content > .modal-card {
    margin: 0;
    width: 100%;
    max-height: inherit;
}

/* A modal that is loading (ui/modal showLoading). When a modal takes a
   while to load, the page is dimmed first, with this small white card in
   the middle: the spinner every reading screen uses (.reading-spinner),
   and a short message under it. The modal then takes the card's place.
   The dim stays as it is, so nothing blinks. The card can not be
   dismissed, so it shows the "busy" cursor. */
.modal-content:has(> .modal-loading) {
    width: auto;
    margin: 0;
    overflow: visible;
}

.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
    min-width: 13rem;
    max-width: min(22rem, calc(100vw - 3rem));
    padding: 1.75rem 2rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
    color: var(--reader-ink-weak);
    background-color: #fff;
    border-radius: 12px;
    box-shadow:
        0 24px 64px -12px rgba(23, 33, 43, 0.35),
        0 2px 6px rgba(23, 33, 43, 0.12);
    outline: none;
    cursor: progress;
    animation: reading-fade-in 160ms ease-out both;
}

.modal:has(.modal-loading) .modal-background {
    cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
    .modal-loading {
        animation: none;
    }
}

@media screen and (max-width: 768px) {
    .modal-content {
        width: calc(100% - 2 * var(--bulma-modal-content-margin-mobile));
    }
}
