/* The Plot Thickens: reusable, audio-first story collection. */
.library-app { min-height: 100dvh; color: var(--charcoal); background: var(--ivory); }
.library-app button, .library-app input, .library-app textarea { font: inherit; }
.library-app button { cursor: pointer; }
.library-app button:disabled { cursor: not-allowed; opacity: .37; }
.library-app button:focus-visible, .library-app input:focus-visible, .library-app textarea:focus-visible, .library-app a:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.library-app button, .library-app a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.library-app .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.library-loading { display: flex; min-height: 100dvh; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: var(--muted-foreground); }
.library-topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: max(17px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) 17px max(24px,env(safe-area-inset-left)); border-bottom: 1px solid var(--border); background: rgba(250,252,251,.95); position: sticky; top: 0; z-index: 15; backdrop-filter: blur(14px); }
.library-brand-button { background: none; border: none; padding: 5px 0; display: flex; align-items: center; }
.library-topnote { font-weight: 850; letter-spacing: .21em; font-size: .64rem; color: #656f72; text-align: center; }
.library-topnote span { color: var(--teal-dark); margin: 0 7px; }
.library-top-home, .library-back { display: inline-flex; align-items: center; gap: 9px; border: 0; background: transparent; font-size: .81rem; font-weight: 800; padding: 12px; }
.library-top-home:hover, .library-back:hover { color: var(--teal-dark); }
.library-kicker { font-size: .68rem; font-weight: 850; letter-spacing: .22em; text-transform: uppercase; color: var(--teal-dark); margin: 0 0 16px; }
.library-hero { min-height: min(650px, 83dvh); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0,.95fr); border-bottom: 1px solid var(--border); }
.library-hero-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(46px,6vw,100px) clamp(28px,7vw,116px); max-width: 900px; }
.library-hero h1 { font-family: 'Arial Black',Impact,ui-sans-serif,sans-serif; margin: 0 0 30px; font-size: clamp(4rem, 8.3vw, 9.4rem); letter-spacing: -.08em; line-height: .85; font-weight: 900; }
.library-hero h1 em { color: var(--teal-dark); font-style: normal; }
.library-hero-copy > p:not(.library-kicker) { margin: 0; font-size: clamp(1rem,1.35vw,1.24rem); line-height: 1.7; color: #4d575a; max-width: 600px; }
.library-hero-stats { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 36px; }
.library-hero-stats span { display: inline-flex; flex-direction: column; gap: 3px; text-transform: uppercase; font-weight: 800; letter-spacing: .1em; font-size: .63rem; color: #5f6a6c; }
.library-hero-stats strong { font-size: 1.55rem; color: var(--charcoal); letter-spacing: -.05em; }
.library-source-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 36px; padding-bottom: 5px; border-bottom: 1px solid var(--teal-dark); color: var(--charcoal); text-decoration: none; font-size: .76rem; font-weight: 800; }
.library-hero-art { position: relative; background: #cddad5; min-height: 480px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; isolation: isolate; }
.library-hero-art::before { content: ''; position: absolute; inset: -35% 3% auto auto; width: 78%; aspect-ratio: 1; border-radius: 50%; background: var(--teal); z-index: -1; }
.library-hero-art::after { content: ''; position: absolute; left: -20%; bottom: -35%; width: 74%; aspect-ratio:1; border-radius:50%; background:#dae9e4; z-index:-1; }
.library-hero-art img { width: 100%; height: 100%; max-height: 640px; object-fit: cover; object-position: center; display: block; }
.library-art-sticker { position: absolute; bottom: clamp(20px,4vw,68px); right: clamp(20px,5vw,76px); transform: rotate(-5deg); background: var(--charcoal); color: var(--ivory); padding: 20px 25px; font-weight: 850; font-size: clamp(1rem,1.65vw,1.6rem); line-height: 1.17; box-shadow: 7px 7px 0 var(--teal); }
.library-catalog { max-width: 1540px; margin: 0 auto; padding: clamp(50px,7vw,100px) clamp(20px,5vw,76px) 110px; }
.library-catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 36px; }
.library-catalog h2 { font-family:'Arial Black',Impact,ui-sans-serif,sans-serif; font-size:clamp(2.2rem,4vw,4.6rem); letter-spacing:-.065em; line-height:1.05; margin:0 0 12px; }
.library-catalog h2 span, .library-stage h2 span { color:var(--teal-dark); }
.library-catalog-heading p:not(.library-kicker) { color:var(--muted-foreground); line-height:1.55; margin:0; }
.library-completion { border:1px solid var(--border); padding:22px 24px; min-width:190px; background:var(--paper); }
.library-completion strong { font-size:2.4rem; line-height:1; font-weight:900; letter-spacing:-.06em; }
.library-completion strong span { font-size:1rem; color:var(--muted-foreground); }
.library-completion small { display:block; margin-top:8px; font-size:.57rem; letter-spacing:.15em; font-weight:850; }
.library-completion-track, .library-card-track { display:block; width:100%; height:4px; background:var(--stone); overflow:hidden; margin-top:16px; }
.library-completion-track i, .library-card-track i { display:block; height:100%; background:var(--teal-dark); transition:width .2s ease; }
.library-tools { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:20px; }
.library-filters { display:flex; flex-wrap:wrap; gap:8px; }
.library-filters button { border:1px solid var(--border); background:transparent; padding:12px 17px; font-size:.79rem; font-weight:800; min-height:44px; }
.library-filters button.active { background:var(--charcoal); border-color:var(--charcoal); color:var(--ivory); }
.library-search { display:flex; align-items:center; gap:10px; border:1px solid var(--border); min-height:46px; width:min(100%,330px); padding:0 14px; background:var(--paper); }
.library-search input { background:transparent; border:0; outline:0; width:100%; min-width:0; color:var(--charcoal); }
.library-results { color:var(--muted-foreground); font-size:.75rem; font-weight:750; text-transform:uppercase; letter-spacing:.1em; margin:0 0 20px; }
.library-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.library-story-card { display:flex; flex-direction:column; text-align:left; min-width:0; min-height:260px; padding:24px 24px 0; border:1px solid var(--border); background:var(--paper); transition:background .18s,border-color .18s,transform .18s; }
.library-story-card:hover { background:#fff; border-color:var(--teal-dark); transform:translateY(-3px); }
.library-card-top { display:flex; justify-content:space-between; gap:8px; align-items:center; font-size:.67rem; letter-spacing:.15em; font-weight:850; color:var(--teal-dark); }
.library-card-theme { color:var(--muted-foreground); margin:31px 0 10px; font-size:.76rem; }
.library-story-card > strong { font-family:'Arial Black',Impact,ui-sans-serif,sans-serif; letter-spacing:-.045em; font-size:clamp(1.3rem,1.7vw,1.9rem); line-height:1.17; overflow-wrap:anywhere; }
.library-card-bottom { display:flex; align-items:center; justify-content:space-between; margin:auto 0 0; padding-top:30px; font-size:.75rem; font-weight:850; }
.library-card-bottom span { font-size:1.3rem; color:var(--teal-dark); }
.library-card-track { margin-top:18px; width:calc(100% + 48px); margin-left:-24px; height:4px; }
.library-empty { padding:50px 20px; color:var(--muted-foreground); text-align:center; }
.library-lesson { width:min(100%,1260px); margin:0 auto; padding:32px clamp(20px,5vw,64px) 75px; }
.library-lesson-top { display:flex; align-items:center; justify-content:space-between; gap:20px; font-size:.72rem; color:var(--muted-foreground); font-weight:750; }
.library-back { padding-left:0; color:var(--charcoal); }
.library-lesson-title { padding:38px 0 34px; border-bottom:1px solid var(--border); }
.library-lesson-title h1 { font-family:'Arial Black',Impact,ui-sans-serif,sans-serif; font-size:clamp(2.7rem,5.9vw,6.5rem); letter-spacing:-.075em; line-height:.98; max-width:1020px; margin:0 0 20px; text-wrap:balance; }
.library-lesson-title > p:last-child { max-width:650px; color:var(--muted-foreground); line-height:1.55; margin:0; }
.library-step-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin:23px 0 42px; overflow-x:auto; -ms-overflow-style:none; scrollbar-width:none; }
.library-step-nav::-webkit-scrollbar { display:none; }
.library-step-nav button { display:flex; gap:8px; align-items:center; text-align:left; background:transparent; border:1px solid var(--border); padding:12px; min-height:52px; font-weight:800; font-size:.72rem; }
.library-step-nav button > span { display:grid; flex:0 0 27px; place-items:center; width:27px; height:27px; border-radius:50%; background:#e6e2d9; font-size:.6rem; }
.library-step-nav button.current { background:var(--charcoal); color:var(--ivory); border-color:var(--charcoal); }
.library-step-nav button.current > span { background:var(--teal); color:var(--charcoal); }
.library-step-nav button:disabled { opacity:.53; }
.library-stage { min-height:500px; display:grid; grid-template-columns:minmax(195px,.32fr) minmax(0,1fr); gap:clamp(24px,4.2vw,72px); padding:40px 0 44px; }
.library-stage-heading { border-right:1px solid var(--border); padding-right:20px; display:flex; flex-direction:column; justify-content:space-between; gap:48px; }
.library-step-number { font-size:.76rem; font-weight:850; color:var(--teal-dark); letter-spacing:.17em; }
.library-stage h2 { font-family:'Arial Black',Impact,ui-sans-serif,sans-serif; font-size:clamp(2.1rem,3.9vw,4.3rem); line-height:1.02; letter-spacing:-.06em; margin:0 0 16px; }
.library-stage-heading p:last-child { color:var(--muted-foreground); font-size:.91rem; line-height:1.55; max-width:240px; }
.library-stage-content { min-width:0; }
.library-instruction { max-width:710px; color:#3e4749; line-height:1.75; margin:0 0 30px; font-size:clamp(1.04rem,1.3vw,1.17rem); }
.library-audio { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:18px; background:var(--charcoal); color:var(--ivory); padding:24px; margin:0 0 27px; }
.library-audio-icon { display:grid; place-items:center; background:var(--teal); color:var(--charcoal); width:54px; height:54px; border-radius:50%; }
.library-audio-info { display:flex; flex-direction:column; gap:6px; }
.library-audio-info strong { font-size:1.04rem; }
.library-audio-info span { font-size:.75rem; color:#c0c9c8; line-height:1.4; }
.library-audio-buttons { display:flex; gap:8px; align-items:center; }
.library-primary, .library-outline { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:48px; padding:12px 18px; font-weight:850; font-size:.8rem; border-radius:2px; }
.library-primary { color:white; background:var(--teal-dark); border:1px solid var(--teal-dark); }
.library-primary:hover { background:#007b7e; }
.library-outline { background:transparent; border:1px solid var(--border); color:var(--charcoal); }
.library-outline:hover:not(:disabled) { border-color:var(--teal-dark); background:rgba(0,179,182,.06); }
.library-icon-button { display:grid; place-items:center; height:48px; width:48px; border:1px solid rgba(255,255,255,.25); background:transparent; color:var(--ivory); }
.library-icon-button:hover { border-color:var(--teal); }
.library-inline-link { grid-column:1 / -1; display:flex; align-items:center; gap:9px; justify-self:start; color:#a5edef; border:0; padding:10px 0 0; background:transparent; font-size:.77rem; font-weight:800; }
.library-rotated { transform:rotate(180deg); }
.library-audio-error { grid-column:1 / -1; margin:0; color:#ffe0c2; }
.library-transcript { grid-column:1 / -1; border-top:1px solid rgba(255,255,255,.23); padding-top:18px; color:#f4f4ed; line-height:1.82; max-width:75ch; }
.library-transcript p { margin:0; }
.library-quiet-note { font-size:.77rem; color:var(--muted-foreground); line-height:1.7; margin:24px 0 0; }
.library-clues { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; margin:0 0 32px; }
.library-clue { display:flex; align-items:center; gap:13px; min-height:70px; padding:14px 16px; font-size:clamp(.88rem,1.2vw,1.12rem); font-weight:750; background:var(--paper); border:1px solid var(--border); overflow-wrap:anywhere; }
.library-clue small { color:var(--teal-dark); font-size:.65rem; font-weight:850; }
.library-notes-label { display:block; margin-bottom:10px; font-size:.73rem; text-transform:uppercase; letter-spacing:.13em; font-weight:850; }
.library-notes { resize:vertical; width:100%; min-height:120px; background:var(--paper); padding:18px; border:1px solid var(--border); line-height:1.6; }
.library-reading { border:1px solid var(--border); background:var(--paper); padding:clamp(23px,4vw,44px); }
.library-reading-bar { display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; padding-bottom:18px; border-bottom:1px solid var(--border); color:var(--teal-dark); font-size:.7rem; text-transform:uppercase; letter-spacing:.12em; font-weight:850; }
.library-reading-bar span:first-child { display:flex; align-items:center; gap:8px; }
.library-reading-text { font-size:clamp(1.02rem,1.35vw,1.18rem); line-height:2; max-width:70ch; margin:28px 0; overflow-wrap:anywhere; }
.library-inline-gap { display:inline-flex; align-items:center; vertical-align:baseline; white-space:nowrap; position:relative; }
.library-inline-gap input { min-height:31px; border:0; border-bottom:2px solid var(--teal-dark); border-radius:0; padding:2px 5px; background:#e1f3f0; font-size:inherit; font-weight:800; color:var(--charcoal); text-align:center; outline-offset:2px; }
.library-inline-gap input[aria-invalid='true'] { border-bottom-color:#a94733; background:#f9e9df; }
.library-gap-ok, .library-gap-retry { font-weight:900; margin-left:3px; color:var(--teal-dark); }
.library-gap-retry { color:#a94733; }
.library-reading-actions { display:flex; flex-wrap:wrap; gap:10px; padding-top:19px; border-top:1px solid var(--border); }
.library-feedback { margin-top:22px; padding:16px; background:#d6eae3; line-height:1.5; }
.library-gap-notes { margin-top:13px; font-size:.84rem; color:var(--muted-foreground); }
.library-gap-notes p { margin:9px 0; }
.library-gap-notes strong { color:var(--charcoal); }
.library-repairs { display:grid; gap:20px; }
.library-repair-card { padding:clamp(22px,3vw,36px); background:var(--paper); border:1px solid var(--border); }
.library-repair-id { font-size:.67rem; font-weight:850; color:var(--teal-dark); letter-spacing:.16em; }
.library-repair-card h3 { font-size:clamp(1.2rem,1.75vw,1.65rem); letter-spacing:-.025em; margin:14px 0 23px; line-height:1.4; }
.library-repair-card label { display:block; font-size:.77rem; font-weight:800; margin-bottom:9px; }
.library-repair-card textarea { display:block; width:100%; padding:14px; background:var(--ivory); border:1px solid var(--border); resize:vertical; min-height:88px; line-height:1.5; margin-bottom:18px; }
.library-correction { background:#e2f2eb; border-left:4px solid var(--teal-dark); margin-top:17px; padding:18px 20px; line-height:1.65; }
.library-correction p { margin:7px 0 0; color:#4b5857; font-size:.85rem; }
.library-grammar-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.library-grammar-grid > div { border:1px solid var(--border); padding:22px; background:var(--paper); overflow-wrap:anywhere; }
.library-grammar-grid > div:first-child { border-top:5px solid var(--teal); }
.library-grammar-grid > div:nth-child(2) { border-top:5px solid #899a9e; }
.library-grammar-grid > div:last-child { border-top:5px solid var(--charcoal); }
.library-grammar-grid span { display:block; font-size:.65rem; font-weight:850; letter-spacing:.12em; color:var(--muted-foreground); }
.library-grammar-grid p { font-size:clamp(1.1rem,1.45vw,1.5rem); line-height:1.5; font-weight:750; margin:30px 0 3px; letter-spacing:-.018em; }
.library-grammar-note { display:flex; gap:13px; align-items:start; background:#dcebe4; padding:21px; margin-top:20px; line-height:1.55; }
.library-grammar-note svg { flex:0 0 auto; color:var(--teal-dark); margin-top:2px; }
.library-source-details { padding:18px 0 30px; border-top:1px solid var(--border); }
.library-source-details summary { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:.76rem; font-weight:850; }
.library-source-details details[open] summary svg { transform:rotate(180deg); }
.library-source-details p { max-width:80ch; color:var(--muted-foreground); font-size:.78rem; line-height:1.7; }
.library-source-details .library-review-note { color:#9b5438; }
.library-lesson-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:20px 0 10px; border-top:1px solid var(--border); }
.library-lesson-footer > span { font-size:.68rem; font-weight:850; letter-spacing:.16em; color:var(--muted-foreground); }
.library-site-footer { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:28px clamp(22px,4vw,64px) max(28px,env(safe-area-inset-bottom)); border-top:1px solid var(--border); font-size:.7rem; color:var(--muted-foreground); }
.library-site-footer .brand-mark { font-size:1.28rem; }
@media (max-width:1100px) { .library-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .library-hero-copy { padding:52px 38px; } .library-hero h1 { font-size:clamp(3.6rem,7.3vw,7rem); } .library-step-nav { grid-template-columns:repeat(5,minmax(145px,1fr)); } .library-grammar-grid { grid-template-columns:1fr; } .library-grammar-grid p { margin-top:14px; } }
@media (max-width:760px) { .library-topnote { display:none; } .library-topbar { min-height:68px; } .library-hero { grid-template-columns:1fr; } .library-hero-copy { padding:60px 25px 45px; } .library-hero h1 { font-size:clamp(4rem,11vw,6rem); } .library-hero-art { min-height:350px; max-height:470px; } .library-hero-art img { max-height:450px; } .library-catalog-heading { align-items:start; flex-direction:column; } .library-completion { width:100%; } .library-tools { align-items:stretch; flex-direction:column; } .library-search { width:100%; max-width:none; } .library-lesson { padding:20px 22px 60px; } .library-lesson-title { padding:24px 0; } .library-lesson-title h1 { font-size:clamp(2.6rem,9vw,4.4rem); } .library-step-nav { margin:18px 0 20px; padding-bottom:6px; scroll-snap-type:x proximity; } .library-step-nav button { scroll-snap-align:start; } .library-stage { grid-template-columns:1fr; gap:28px; padding:20px 0 30px; } .library-stage-heading { flex-direction:row; gap:24px; padding:0 0 18px; border:0; border-bottom:1px solid var(--border); } .library-stage-heading h2 { font-size:clamp(2.1rem,7vw,3.4rem); } .library-stage-heading p:last-child { max-width:none; } .library-audio { grid-template-columns:54px 1fr; } .library-audio-buttons { grid-column:1 / -1; width:100%; } .library-audio-play { flex:1; } .library-audio-info strong { font-size:.95rem; } .library-clues { grid-template-columns:1fr; } }
@media (max-width:520px) { .library-grid { grid-template-columns:1fr; } .library-story-card { min-height:245px; } .library-catalog { padding:48px 20px 70px; } .library-hero-copy { padding:48px 22px 38px; } .library-hero h1 { font-size:clamp(3.55rem,15vw,5.4rem); } .library-hero-art { min-height:300px; } .library-art-sticker { padding:13px 16px; font-size:1rem; right:18px; bottom:17px; } .library-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } .library-lesson-top > span { display:none; } .library-lesson { padding-inline:17px; } .library-step-nav { grid-template-columns:repeat(5,minmax(130px,1fr)); } .library-stage-heading { flex-direction:column; gap:12px; } .library-audio { padding:18px; gap:12px; } .library-reading { padding:19px; } .library-reading-text { line-height:2.1; } .library-reading-actions > button { flex:1 1 100%; } .library-lesson-footer > span { display:none; } .library-lesson-footer > button { flex:1; } .library-site-footer { flex-wrap:wrap; } .library-site-footer > span:last-child { display:none; } }
@media (hover:none) { .library-story-card:hover { transform:none; } }
@media (prefers-reduced-motion:reduce) { .library-app *, .library-app *::before, .library-app *::after { transition:none !important; scroll-behavior:auto !important; } }

/* Guess Who: keep neutral choices and the reveal clearly distinct. */
.library-guess { background:var(--paper); border:1px solid var(--border); padding:clamp(20px,3vw,32px); margin-top:28px; }
.library-guess h3 { font-family:'Arial Black',Impact,ui-sans-serif,sans-serif; font-size:clamp(1.55rem,2.5vw,2.45rem); letter-spacing:-.05em; margin:0 0 10px; }
.library-guess > p:not(.library-kicker) { max-width:62ch; margin:0 0 22px; color:var(--muted-foreground); line-height:1.6; }
.library-guess-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0 0 18px; }
.library-guess-choice { min-height:56px; padding:13px 12px; border:1px solid var(--border); background:var(--ivory); font-weight:800; text-align:center; }
.library-guess-choice:hover:not(:disabled), .library-guess-choice.selected { border-color:var(--teal-dark); background:#e5f6f2; }
.library-guess-choice.selected { box-shadow:inset 0 0 0 2px var(--teal-dark); }
.library-guess-choice:disabled { opacity:1; cursor:default; }
.library-guess-confirm { width:100%; }
.library-guess-result { display:flex; align-items:flex-start; gap:12px; background:#e5f6f2; border-left:4px solid var(--teal-dark); padding:19px; line-height:1.55; }
.library-guess-result svg { color:var(--teal-dark); flex:0 0 auto; }
.library-guess-result strong { font-size:1.1rem; }
.library-guess-result p { margin:6px 0 0; }
@media(max-width:520px) { .library-guess-options { grid-template-columns:1fr; } }


/* 2026-09 learning-first refinement
   Keep the tandem image as a brand cue, not the lesson itself. */
.library-home {
  background: #f8faf9;
}
.library-topbar {
  min-height: 64px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: 12px;
  box-shadow: 0 1px 0 rgba(22,52,50,.04);
}
.library-topnote {
  letter-spacing: .13em;
  font-size: .6rem;
}
.library-hero {
  width: min(calc(100% - 40px), 1280px);
  min-height: 0;
  margin: 28px auto 0;
  grid-template-columns: minmax(0,1fr) 300px;
  border: 1px solid #dbe5e1;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}
.library-hero-copy {
  padding: clamp(34px,4.5vw,62px);
  max-width: 820px;
}
.library-hero .library-kicker {
  margin-bottom: 11px;
}
.library-hero h1 {
  margin: 0 0 15px;
  max-width: 720px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.1rem,4.4vw,4.35rem);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 850;
}
.library-hero h1 em {
  color: inherit;
}
.library-hero-copy > p:not(.library-kicker) {
  max-width: 720px;
  font-size: clamp(.98rem,1.25vw,1.08rem);
  line-height: 1.62;
  color: #50605d;
}
.library-hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.library-hero-start {
  min-height: 46px;
  border-radius: 10px;
  padding-inline: 18px;
}
.library-hero-stats {
  margin: 0;
  gap: 18px;
}
.library-hero-stats span {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: baseline;
  text-transform: none;
  letter-spacing: 0;
  font-size: .78rem;
  font-weight: 650;
  color: #687673;
}
.library-hero-stats strong {
  font-size: 1rem;
  letter-spacing: -.02em;
}
.library-hero-art {
  min-height: 0;
  background: #dce9e5;
  border-left: 1px solid #dbe5e1;
}
.library-hero-art::before,
.library-hero-art::after,
.library-art-sticker {
  display: none;
}
.library-hero-art img {
  width: 100%;
  height: 100%;
  min-height: 250px;
  max-height: none;
  object-fit: cover;
  object-position: center;
}
.library-catalog {
  max-width: 1280px;
  padding: 44px 20px 86px;
}
.library-catalog-heading {
  align-items: center;
  margin-bottom: 24px;
}
.library-catalog h2 {
  margin: 0 0 8px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.65rem,2.6vw,2.45rem);
  letter-spacing: -.04em;
  line-height: 1.12;
  font-weight: 820;
}
.library-catalog-heading p:not(.library-kicker) {
  max-width: 720px;
  font-size: .94rem;
}
.library-completion {
  min-width: 164px;
  padding: 16px 18px;
  border-radius: 12px;
  box-shadow: none;
}
.library-completion strong {
  font-size: 1.75rem;
}
.library-tools {
  margin: 6px 0 18px;
  padding-top: 18px;
  border-top: 1px solid #e3ebe8;
}
.library-filters button,
.library-search {
  border-radius: 10px;
}
.library-filters button {
  padding: 9px 13px;
  min-height: 40px;
  font-size: .75rem;
}
.library-search {
  min-height: 42px;
}
.library-unit {
  margin-top: 30px;
  background: #fff;
  border: 1px solid #dde7e3;
  border-radius: 16px;
  padding: 22px;
}
.library-unit + .library-unit {
  margin-top: 18px;
}
.library-unit-heading {
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 15px;
}
.library-unit-heading h3 {
  margin: 4px 0 6px;
  font-size: clamp(1.25rem,2vw,1.65rem);
  letter-spacing: -.03em;
}
.library-unit-heading p:last-child {
  margin: 0;
  font-size: .86rem;
}
.library-unit-count {
  padding: 7px 10px;
  font-size: .72rem;
  background: #f8fbfa;
}
.library-grid {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
}
.library-story-card {
  min-height: 180px;
  padding: 18px 18px 0;
  border-radius: 12px;
  border-color: #e0e8e5;
  box-shadow: none;
}
.library-story-card:hover {
  transform: translateY(-1px);
  border-color: #7db5b1;
  box-shadow: 0 8px 20px rgba(30,70,65,.055);
}
.library-card-top {
  font-size: .58rem;
  letter-spacing: .1em;
}
.library-card-theme {
  margin: 18px 0 7px;
  font-size: .7rem;
}
.library-story-card > strong {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1rem,1.25vw,1.22rem);
  line-height: 1.3;
  letter-spacing: -.025em;
  font-weight: 780;
}
.library-card-bottom {
  padding-top: 19px;
  font-size: .69rem;
}
.library-card-track {
  width: calc(100% + 36px);
  margin-left: -18px;
  margin-top: 13px;
  height: 3px;
}
.library-site-footer {
  padding-block: 22px;
  background: #fff;
}

/* Lesson pages: keep the learner's attention on one task at a time. */
.library-app:has(.library-lesson) .library-topbar {
  box-shadow: 0 1px 0 rgba(22,52,50,.05);
}
.library-app:has(.library-lesson) .library-lesson-title {
  display: flex;
  align-items: center;
  min-height: 38px;
}
.library-app:has(.library-lesson) .library-lesson-title .library-kicker {
  color: #465754;
}
.library-step-nav button {
  background: #fff;
}
.library-stage-content,
.library-reading,
.library-repair-card,
.activity-question,
.activity-examples {
  box-shadow: none !important;
}
.library-audio {
  background: #183c3b;
}
.library-clue {
  border-color: #dfe8e4;
  background: #fff;
}
.library-primary {
  border-radius: 9px;
}
.library-outline {
  border-radius: 9px;
}
.library-reading-text {
  color: #263532;
}
.activity-bank {
  background: #f4f8f6;
}
.activity-tile {
  box-shadow: none;
}
.library-correction,
.library-feedback,
.activity-rule {
  background: #eaf4f0;
}

@media (max-width: 1050px) {
  .library-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .library-hero { grid-template-columns: minmax(0,1fr) 240px; }
}
@media (max-width: 780px) {
  .library-hero {
    width: min(calc(100% - 28px), 1280px);
    margin-top: 16px;
    grid-template-columns: 1fr;
  }
  .library-hero-copy {
    padding: 30px 24px 24px;
  }
  .library-hero-art {
    height: 150px;
    min-height: 150px;
    border-left: 0;
    border-top: 1px solid #dbe5e1;
  }
  .library-hero-art img {
    min-height: 150px;
    height: 150px;
    object-position: center 44%;
  }
  .library-catalog { padding-top: 32px; }
  .library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .library-unit { padding: 18px; }
}
@media (max-width: 520px) {
  .library-hero h1 { font-size: clamp(2rem,10vw,2.8rem); }
  .library-hero-actions { align-items: stretch; flex-direction: column; gap: 14px; }
  .library-hero-start { width: 100%; }
  .library-hero-stats { justify-content: space-between; }
  .library-catalog { padding-inline: 14px; }
  .library-catalog-heading { gap: 16px; }
  .library-unit { padding: 15px; border-radius: 13px; }
  .library-grid { grid-template-columns: 1fr; }
  .library-story-card { min-height: 156px; }
}


/* Image-led entry screen */
.library-welcome {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: #0194aa;
  color: #fff;
}
.library-welcome-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.library-welcome-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,28,28,.12) 0%, rgba(10,28,28,.08) 42%, rgba(10,28,28,.68) 100%),
    linear-gradient(90deg, rgba(10,28,28,.32) 0%, rgba(10,28,28,0) 50%);
}
.library-welcome-content {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  width: min(100% - 40px, 1240px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 0 max(36px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.library-welcome-content .brand-mark {
  margin-bottom: auto;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,.16));
}
.library-welcome-content .brand-fluency {
  color: #fff;
}
.library-welcome-content .brand-lab {
  color: #58d6d1;
}
.library-welcome-content > p {
  margin: 0 0 16px;
  max-width: 520px;
  font-size: clamp(1.2rem,2vw,1.75rem);
  line-height: 1.3;
  font-weight: 720;
  letter-spacing: -.025em;
  text-shadow: 0 2px 18px rgba(0,0,0,.24);
}
.library-welcome-enter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 17px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #173634;
  font-weight: 820;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.library-welcome-enter:hover {
  background: #eef8f5;
}
.library-welcome-enter:focus-visible {
  outline: 3px solid #58d6d1;
  outline-offset: 4px;
}
@media (max-width: 620px) {
  .library-welcome-content {
    width: min(100% - 28px, 1240px);
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .library-welcome-image {
    object-position: 50% center;
  }
  .library-welcome-content > p {
    font-size: 1.18rem;
    max-width: 320px;
  }
  .library-welcome-enter {
    width: 100%;
    justify-content: center;
  }
}


/* Desktop welcome image: preserve faces by containing artwork inside a framed card. */
@media (min-width: 900px) {
  .library-welcome {
    display: grid;
    place-items: center;
    padding: 34px;
    background:
      radial-gradient(circle at top left, rgba(88,214,209,.16), transparent 34%),
      #0194aa;
  }

  .library-welcome-image {
    position: relative;
    inset: auto;
    width: min(1180px, calc(100vw - 68px));
    height: min(760px, calc(100vh - 68px));
    object-fit: contain;
    object-position: center;
    border-radius: 22px;
    background: #dce9e5;
    box-shadow: 0 28px 80px rgba(0,0,0,.28);
    z-index: 0;
  }

  .library-welcome-shade {
    position: absolute;
    inset: 34px;
    width: min(1180px, calc(100vw - 68px));
    height: min(760px, calc(100vh - 68px));
    margin: auto;
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(10,28,28,.04) 0%, rgba(10,28,28,.03) 54%, rgba(10,28,28,.54) 100%);
    pointer-events: none;
    z-index: 1;
  }

  .library-welcome-content {
    position: absolute;
    inset: 34px;
    width: min(1180px, calc(100vw - 68px));
    height: min(760px, calc(100vh - 68px));
    margin: auto;
    padding: 28px 32px 30px;
    z-index: 2;
  }
}
