/* ==========================================================================
   പള്ളിക്കൂടം — the school book, page by page
   ========================================================================== */
.chip--gold { background: var(--gold-soft); color: var(--gold-deep); }

/* ---- Home: the two books ---------------------------------------------- */
.pb-source { margin-top: 8px; font-size: .85rem; color: var(--ink-3); }
.pb-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.pb-card { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.pb-card.is-mine { border: 2px solid var(--gold); box-shadow: 0 6px 0 var(--gold-soft), var(--shadow-1); }
.pb-cover { width: 92px; aspect-ratio: 3 / 4; border-radius: 10px 16px 16px 10px; display: grid; place-content: center; justify-items: center; gap: 2px; color: #FFF8EC;
  background: linear-gradient(90deg, rgba(0,0,0,.18) 0 7px, transparent 7px), linear-gradient(160deg, var(--red), var(--red, #B3136B));
  box-shadow: inset 0 -10px 0 var(--gold), 0 8px 18px rgba(43,21,20,.18); }
.pb-cover-n { font: 800 2.6rem/1 var(--f-display); }
.pb-cover-t { font-size: .9rem; font-weight: 700; }
.pb-body { display: grid; gap: 8px; min-width: 0; justify-items: start; }
.pb-body h2 { display: grid; gap: 2px; font-size: 1.35rem; }
.pb-body h2 .en { font: 600 .9rem var(--f-ui); color: var(--ink-2); }
.pb-meta { font-size: .88rem; color: var(--ink-3); }
.pb-progress { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink-2); font-size: .9rem; }
.pb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@media (max-width: 480px) { .pb-card { grid-template-columns: 1fr; } .pb-cover { width: 70px; } }

/* ---- Contents ------------------------------------------------------------- */
.toc-block { margin-top: 30px; }
.toc-block .sec-title { margin-bottom: 12px; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.toc-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.toc-row:hover { border-color: var(--teal); }
.toc-row.is-done { background: linear-gradient(90deg, var(--leaf-soft), var(--surface) 60%); }
.toc-name { flex: 1; display: grid; min-width: 0; }
.toc-name .ml { font-weight: 700; }
.toc-name .en { font-size: .85rem; color: var(--ink-3); }
.toc-pages { font-size: .82rem; color: var(--ink-3); white-space: nowrap; }
.week-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.week-card { height: 100%; display: grid; grid-template-rows: 1fr auto; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.week-card.is-read { border-color: var(--leaf); }
.week-main { display: grid; gap: 3px; padding: 14px 16px 10px; color: var(--ink); text-decoration: none; }
.week-main:hover { background: var(--surface-2); }
.week-n { display: flex; align-items: baseline; gap: 6px; color: var(--red); font-weight: 700; font-size: .85rem; }
.week-n b { font: 800 1.5rem/1 var(--f-display); }
.week-title { font-weight: 700; font-size: 1.02rem; line-height: 1.35; }
.week-en { font-size: .82rem; color: var(--ink-2); }
.week-pages { font-size: .75rem; color: var(--ink-3); margin-top: 2px; }
.week-prac { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border-top: 1px dashed var(--line-2); font: 600 .85rem var(--f-ui); color: var(--teal-deep); text-decoration: none; background: var(--surface-2); }
.week-prac:hover { background: var(--teal-soft); }
.week-card.is-practised .week-prac { color: var(--leaf); background: var(--leaf-soft); }
.week-prac .icon { width: 18px; height: 18px; }

/* ---- A page of the book ----------------------------------------------- */
.pp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.pp-where { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pp-page { display: inline-flex; align-items: baseline; gap: 8px; font-weight: 700; color: var(--red); }
.pp-page b { font: 800 2.2rem/1 var(--f-display); }
.pp-of { color: var(--ink-3); font-weight: 600; }
.pp-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 2px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: 600 .88rem var(--f-ui); cursor: pointer; }
.pp-toggle .icon { width: 18px; height: 18px; }
.pp-toggle[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-deep); }

.pp-wrap { display: grid; gap: 20px; }
.pp-sheet { position: relative; padding: clamp(18px, 3vw, 40px) clamp(16px, 4vw, 48px) 32px; border-radius: 8px 8px 22px 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(43,21,20,.08); }
.pp-sheet::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; border-radius: 8px 8px 0 0; background: linear-gradient(90deg, var(--red), var(--gold) 50%, var(--teal)); }
.pp-body { display: grid; gap: 14px; }
.pp-blank { color: var(--ink-3); font-style: italic; text-align: center; padding: 40px 0; }
.pp-block { margin: 0; min-width: 0; }
.pp-body .rt-line { font-family: var(--f-ml); font-weight: 500; font-size: 1.12rem; line-height: 1.85; }
.pp-plain { font-size: 1rem; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.pp-en { margin-top: 2px; font-size: .88rem; line-height: 1.45; color: var(--teal-deep); font-style: italic; }
.pp-body:not(.show-en) .pp-en:not(.is-always) { display: none; }
.pp-fix { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--gold-soft); color: var(--gold-deep); font-size: .78rem; }
.pp-fix .icon { width: 14px; height: 14px; }

.pp-head-block { text-align: left; }
.pp-h1, .pp-h2, .pp-h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-h1 { justify-content: center; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); color: var(--red); text-align: center; }
.pp-head-block:has(.pp-h1) { text-align: center; }
.pp-head-block:has(.pp-h1) .pp-en { text-align: center; }
.pp-h2 { font-size: 1.22rem; color: var(--teal-deep); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.pp-h3 { font-size: 1.06rem; color: var(--ink); }
.pp-h1 .ml, .pp-h2 .ml, .pp-h3 .ml { font-family: var(--f-display); }

.pp-list { padding-left: 1.6em; display: grid; gap: 6px; }
.pp-list.is-indent { margin-left: 1.4em; }
.pp-list li::marker { color: var(--red); font-weight: 700; }
ul.pp-list { list-style: "➢  "; }

.pp-note { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 16px; border-radius: 16px; background: var(--gold-soft); border-left: 5px solid var(--gold); }
.pp-note > .icon { width: 20px; height: 20px; color: var(--gold-deep); margin-top: 6px; }

.pp-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line-2); max-width: 100%; }
.pp-table-wrap:focus-visible { outline: 3px solid var(--focus); }
.pp-table { border-collapse: collapse; width: 100%; font-size: .98rem; }
.pp-table th, .pp-table td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; min-width: 5em; }
.pp-table th { background: var(--surface-2); font-weight: 700; }
.pp-table-wrap > .pp-en { padding: 6px 12px; }
.pp-cell-say { border: 0; background: none; padding: 2px 0; font: inherit; font-family: var(--f-ml); color: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
.pp-cell-say:hover { background: var(--teal-soft); }

.pp-kural { margin: 6px 0; padding: 18px 20px; border-radius: 20px; background: linear-gradient(160deg, var(--gold-soft), var(--surface) 70%); border: 2px solid var(--gold); display: grid; gap: 8px; }
.pp-kural-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pp-kural-lines .rt-line { font-family: var(--f-display) !important; font-weight: 700 !important; font-size: 1.3rem !important; color: var(--red); line-height: 1.6 !important; }
.pp-kural-meaning { display: grid; gap: 4px; padding-top: 8px; border-top: 1px dashed var(--gold); }
.pp-kural-meaning > div { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }

.pp-words { display: grid; gap: 10px; }
.pp-word-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.pp-word { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px; padding: 10px 12px; min-height: 58px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; }
.pp-word:hover { border-color: var(--teal); }
.pp-word .icon { grid-row: 1 / span 2; grid-column: 2; width: 18px; height: 18px; color: var(--teal); }
.pp-word-ml { font-family: var(--f-display); font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.pp-word-en { font-size: .8rem; color: var(--ink-2); }

.pp-eq { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pp-eq li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-eq-part { border: 0; padding: 4px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink); font: 500 1.08rem var(--f-ml); cursor: pointer; text-align: left; }
.pp-eq-part.is-result { background: var(--teal-soft); color: var(--teal-deep); font-weight: 700; }
.pp-eq-sign { color: var(--ink-3); font-weight: 700; }

.pp-fill { padding: 16px; border-radius: 18px; border: 2px dashed var(--teal); background: var(--surface-2); display: grid; gap: 12px; }
.pp-fill-prompt { display: grid; gap: 4px; justify-items: start; }
.pp-fill-list { margin: 0; padding-left: 1.4em; display: grid; gap: 12px; }
.pp-fill-q { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 1.08rem; }
.fill-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.fill-input { min-height: 44px; min-width: 0; flex: 1 1 180px; max-width: 320px; padding: 6px 12px; border-radius: 12px; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 1.1rem var(--f-ml); }
.fill-input.is-right { border-color: var(--leaf); }
.fill-input.is-wrong { border-color: var(--red); }
.fill-out { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.fill-out:empty { display: none; }
.fill-ans b { font-size: 1.2rem; color: var(--teal-deep); }
.fill-self { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 500; color: var(--ink-2); }
.fill-open { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: .9rem; }
.fill-open .icon { width: 16px; height: 16px; }

.pp-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; overflow-wrap: anywhere; }
.pp-img { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--ink-2); font-size: .9rem; }
.pp-img .icon { flex: none; width: 22px; height: 22px; color: var(--red, var(--red)); }
.pp-lines { display: grid; gap: 22px; padding: 10px 0; }
.pp-lines span { display: block; border-bottom: 2px dotted var(--line-2); height: 1px; }

.pp-noimg { padding: 30px 12px; border: 1px dashed var(--line-2); border-radius: 12px; }

.pp-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.pp-count { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.pp-jump { width: 4.6em; min-height: 40px; padding: 4px 8px; border-radius: 10px; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink); font: 700 1rem var(--f-ui); text-align: center; }
@media (max-width: 560px) {
  .pp-nav { display: grid; grid-template-columns: 1fr 1fr; }
  .pp-count { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
  .pp-nav .btn { width: 100%; padding-inline: .6em; }
  .pp-page b { font-size: 1.8rem; }
}

/* ---- Week practice -------------------------------------------------------- */
.wk-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.wk-tab { display: grid; justify-items: center; min-width: 110px; padding: 8px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; }
.wk-tab .ml { font-weight: 700; }
.wk-tab .en { font-size: .78rem; }
.wk-tab[aria-selected="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-deep); }
.wk-plan { display: grid; gap: 22px; }
.wk-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.wk-list li { padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.wk-list .rt-line { font-size: 1.05rem; line-height: 1.7; font-family: var(--f-ml); font-weight: 500; }

.fc { display: grid; gap: 14px; justify-items: center; }
.fc-card { width: min(100%, 440px); min-height: 220px; display: grid; place-content: center; gap: 10px; padding: 24px; border-radius: 28px; border: 0; cursor: pointer; text-align: center;
  background: linear-gradient(160deg, var(--gold-soft), var(--surface) 70%); box-shadow: 0 6px 0 var(--gold), var(--shadow-2); color: var(--ink); transition: transform .3s var(--spring); }
.fc-card:active { transform: scale(.97); }
.fc-card.is-flipped { background: linear-gradient(160deg, var(--teal-soft), var(--surface) 70%); box-shadow: 0 6px 0 var(--teal), var(--shadow-2); }
.fc-ml { font: 800 clamp(2rem, 1.6rem + 2vw, 2.8rem)/1.25 var(--f-display); color: var(--red); overflow-wrap: anywhere; }
.fc-en { font: 700 1.3rem var(--f-ui); color: var(--teal-deep); }
.fc-hint { font-size: .85rem; color: var(--ink-3); }
.fc-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.fc-all { width: 100%; margin-top: 10px; }
.fc-all summary { cursor: pointer; font-weight: 600; color: var(--teal); min-height: 44px; display: flex; align-items: center; }

.pr { display: grid; gap: 14px; max-width: 760px; }
.pr-box { display: grid; gap: 14px; justify-items: stretch; }
.pr-box > .btn { justify-self: center; }
.pr-q { display: grid; gap: 4px; }
.pr-built { min-height: 58px; padding: 12px 16px; border-radius: 16px; border: 2px dashed var(--line-2); background: var(--surface); font: 700 1.3rem var(--f-display); color: var(--teal-deep); }
.pr-pool { display: flex; flex-wrap: wrap; gap: 10px; }
.pr-tile { height: auto; min-height: 56px; font-size: 1.3rem; padding: 8px 16px; cursor: pointer; }
.pr-tile:disabled { opacity: .35; }
.pr-box > .btn--ghost.btn--small { justify-self: start; }

/* ---- Dictation & topics --------------------------------------------------- */
.dict-tests { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.dict-card { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; }
.dict-card h2 { font-size: 1.25rem; }
.dict-card h2 .en { font: 600 .9rem var(--f-ui); color: var(--ink-2); }
.dict-card details summary { cursor: pointer; font-weight: 600; color: var(--teal); min-height: 44px; display: flex; align-items: center; }
.dict-run { margin-top: 18px; display: grid; gap: 16px; justify-items: center; text-align: center; padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.dict-listen { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.dict-hint { display: flex; align-items: center; gap: 6px; color: var(--ink-2); flex-wrap: wrap; justify-content: center; }
.dict-hint .icon { width: 18px; height: 18px; }
.dict-reveal { display: grid; gap: 10px; justify-items: center; }
.dict-word { font: 800 clamp(2.2rem, 1.8rem + 2vw, 3rem)/1.2 var(--f-display); color: var(--red); }
.topic-list { margin: 0; padding-left: 2.2em; display: grid; gap: 10px; }
.topic-list li::marker { color: var(--red); font-weight: 800; }
.topic-item { padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.topic-item .rt-line { font-family: var(--f-ml); font-weight: 500; font-size: 1.05rem; line-height: 1.7; }

.palli-home h1, .palli-book h1, .palli-week h1, .palli-dict h1, .palli-topics h1 { overflow-wrap: anywhere; font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); }

/* ---- Homework help (Tamil Palli week page) ------------------------------ */
.hw-help { display: grid; gap: 12px; }
.hw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hw-item { padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; }
.hw-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.hw-top .rt { flex: 1 1 240px; }
.hw-top .rt-line { font-family: var(--f-ml); font-weight: 600; font-size: 1.05rem; line-height: 1.6; }
.hw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hw-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hw-links .btn { min-height: 38px; }
.hw-links .btn .en { font-size: .82rem; color: var(--ink-2); }

/* ==========================================================================
   Songs (shared)
   ========================================================================== */
.song-sections { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.song-sec-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; min-height: 110px; border-radius: var(--r-lg); text-decoration: none; color: var(--ink);
  background: linear-gradient(150deg, var(--h1, var(--gold-soft)), var(--surface) 75%); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.song-sec-card:hover { border-color: var(--hi, var(--teal)); transform: translateY(-2px); }
.song-sec-emoji { font-size: 2.6rem; line-height: 1; }
.song-sec-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.song-sec-text .ml { font: 800 1.35rem/1.3 var(--f-display); color: var(--hi, var(--red)); }
.song-sec-text .en { font-weight: 600; color: var(--ink-2); }
.song-sec-meta { font-size: .82rem; color: var(--ink-3); }
.song-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.song-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.song-row:hover { border-color: var(--teal); }
.song-row.is-learned { background: linear-gradient(90deg, var(--leaf-soft), var(--surface) 60%); }
.song-row-emoji { font-size: 1.8rem; }
.song-row-text { flex: 1; display: grid; min-width: 0; }
.song-row-text .ml { font: 700 1.15rem/1.4 var(--f-display); }
.song-row-text .en { font-size: .9rem; color: var(--ink-2); }
.song-when { font-size: .8rem; color: var(--ink-3); }
.kural-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.kural-card { height: 100%; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: start; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.kural-card:hover { border-color: var(--gold); }
.kural-card.is-learned { border-color: var(--leaf); background: linear-gradient(160deg, var(--leaf-soft), var(--surface) 70%); }
.kural-card .chip { grid-column: 2; justify-self: start; }
.kural-num { display: grid; place-items: center; min-width: 2.4em; height: 2.4em; padding: 0 .4em; border-radius: 12px; background: var(--gold-soft); color: var(--gold-deep); font: 800 .9rem var(--f-ui); }
.kural-lines { display: grid; font-weight: 600; line-height: 1.55; }
.songs-section .sec-title .chip { margin-left: 8px; }
.song-source { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: .88rem; color: var(--ink-2); }
.song-source .icon { width: 16px; height: 16px; }
.song-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; align-items: center; }
.song-sheet { padding: clamp(16px, 3vw, 32px); border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(43,21,20,.06); }
.song-sheet.is-kural { background: linear-gradient(160deg, var(--gold-soft), var(--surface) 70%); border: 2px solid var(--gold); }
.song-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.song-line { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 6px 8px; border-radius: 14px; transition: background .2s; }
.song-line.is-singing { background: var(--gold-soft); box-shadow: inset 4px 0 0 var(--gold); }
.song-line-say { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--teal-soft); color: var(--teal-deep); cursor: pointer; }
.song-line-say .icon { width: 20px; height: 20px; }
.song-line-body { min-width: 0; }
.song-line .rt-line { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.15rem, 1rem + .7vw, 1.45rem); line-height: 1.65; color: var(--ink); }
.song-sheet.is-kural .rt-line { color: var(--red); }
.song-tr, .song-en { margin: 2px 0 0; font-size: .9rem; }
.song-tr { color: var(--ink-3); font-family: var(--f-ui); display: none; }
.song-en { color: var(--teal-deep); font-style: italic; display: none; }
.song-lines.show-tr .song-tr, .song-lines.show-en .song-en { display: block; }
.rt-word.is-hidden-word { color: transparent !important; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 9px) left 78% / 100% 3px no-repeat; }
.song-meaning { margin-top: 20px; display: grid; gap: 8px; padding: 16px 18px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.song-meaning .rt-line { font-family: var(--f-ml); font-weight: 500; font-size: 1.05rem; }
.song-done { display: flex; justify-content: center; margin: 22px 0 6px; }
.btn--good { background: var(--leaf); color: #fff; }
@media (max-width: 560px) { .song-tools .pp-toggle { flex: 1 1 auto; justify-content: center; } }

/* ---- Read the page (js/ui/reader.js) ---- */
.reader { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 12px; margin: 0 0 14px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1); }
.reader.is-sticky.is-playing { position: sticky; top: calc(var(--top-h, 64px) + 8px); z-index: 20; }
.reader.is-on { border-color: var(--teal); }
.reader.is-compact { padding: 6px 0 0; margin: 4px 0 0; background: none; border: 0; box-shadow: none; }
.rd-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rd-play { min-height: 46px; gap: 8px; }
.rd-play .rd-txt { display: inline-flex; gap: 6px; align-items: baseline; }
.rd-play .ml { font-family: var(--f-ml); font-weight: 700; }
.rd-play svg, .rd-stop svg { width: 20px; height: 20px; }
.rd-stop { min-height: 46px; }
.rd-where { font-size: .9rem; color: var(--ink-2); min-width: 7ch; }
.rd-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rd-speeds { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.rd-speed { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 12px; border: 0; border-radius: 999px; background: none; color: var(--ink); font: 600 .9rem var(--f-ui); cursor: pointer; }
.rd-speed .ml { font-family: var(--f-ml); font-size: .88rem; }
.rd-speed .en { font-size: .78rem; color: var(--ink-2); }
.rd-speed svg { width: 18px; height: 18px; }
.rd-speed[aria-checked="true"] { background: var(--teal); color: var(--on-teal, #fff); }
.rd-speed[aria-checked="true"] .en { color: inherit; }
.rd-speed:focus-visible { outline: 3px solid var(--focus, var(--teal)); outline-offset: 2px; }
.rd-echo { min-height: 44px; }
@media (max-width: 560px) {
  .reader { padding: 8px; gap: 8px; }
  .rd-main, .rd-opts { width: 100%; }
  .rd-play, .rd-stop { min-height: 44px; }
  .rd-play .ml { display: none; }
  .rd-speed .ml { display: none; }
  .rd-speed .en { font-size: .85rem; color: inherit; }
  .rd-speed { padding: 4px 10px; }
  .rd-speeds { flex-wrap: nowrap; }
  .rd-echo span { font-size: .85rem; }
  .reader.is-sticky.is-playing { top: calc(var(--top-h, 60px) + 4px); }
}
[data-say].is-speaking { background: var(--gold-soft); box-shadow: 0 0 0 4px var(--gold-soft); border-radius: 8px; outline: 2px solid var(--gold); outline-offset: 2px; transition: background .2s; }
[data-say].is-speaking.is-echo { outline-style: dashed; outline-color: var(--teal); }
:root[data-contrast="high"] [data-say].is-speaking { outline-width: 3px; }

/* ---- Homework on the book page ---- */
.pp-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 12px; }
.pp-quick-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.pp-quick-btn .ml { font-family: var(--f-ml); }
.pp-quick-btn .en { color: var(--ink-2); font-size: .9rem; }
.pp-quick-btn.is-hw { background: var(--gold-soft); border-color: var(--gold); }
.pp-quick-btn svg { width: 18px; height: 18px; flex: none; }
.hw-week { margin: 0 0 16px; border-radius: 18px; border: 1.5px solid var(--gold); background: var(--surface); overflow: hidden; scroll-margin-top: 90px; }
.hw-week > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; background: var(--gold-soft); min-height: 52px; }
.hw-week > summary::-webkit-details-marker { display: none; }
.hw-week-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--gold); color: var(--on-marigold); flex: none; }
.hw-week-ico svg { width: 20px; height: 20px; }
.hw-week-title { display: grid; flex: 1; min-width: 0; }
.hw-week-title .ml { font-family: var(--f-ml); font-weight: 700; font-size: 1.05rem; }
.hw-week-title .en { font-size: .88rem; color: var(--ink-2); }
.hw-week-open svg { width: 20px; height: 20px; transition: transform .2s; }
.hw-week[open] .hw-week-open svg { transform: rotate(90deg); }
.hw-week > .hw-list { padding: 12px; }
.hw-week-more { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; margin: 0; }

.hw-ex { border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.hw-ex > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--teal-deep); }
.hw-ex > summary .ml { font-family: var(--f-ml); }
.hw-ex > summary svg { width: 18px; height: 18px; }
.hw-ex-body { padding: 0 12px 12px; display: grid; gap: 8px; }
.hw-ex-how { margin: 0; line-height: 1.5; }
.hw-ex-model { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.hw-ex-line { display: flex; align-items: flex-start; gap: 6px; }
.hw-ex-line .rt { flex: 1; min-width: 0; }
.hw-ex-line .rt-line { font-size: 1.05rem; line-height: 1.7; margin: 0; }
.hw-ex-en { margin: 2px 0 0; color: var(--ink-2); font-size: .92rem; }
.hw-ex-tip { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--leaf-soft); font-size: .92rem; }
.hw-ex-tip svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
/* A checked answer box stays a text box (so the on-screen keyboard stays open) but can't change */
.fill-input[aria-readonly="true"] { caret-color: transparent; }
.fill-label { flex-basis: 100%; font-weight: 700; font-size: .95rem; color: var(--ink-2); }
.fill-kbd { flex-basis: 100%; margin: 2px 0 0; font-size: .9rem; color: var(--ink-2); }
.dict-type { justify-content: center; width: 100%; max-width: 560px; }
.dict-type .fill-label, .dict-type .fill-kbd { text-align: center; }
.dict-input { max-width: 360px; min-height: 52px; font-size: 1.3rem; text-align: center; }
.dict-type .btn { min-height: 44px; }
.dict-result { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.pp-fill > .fill-kbd { margin: 4px 0 6px; }
.fill-open-box { align-items: stretch; }
.fill-open-in { flex: 1 1 100%; width: 100%; min-height: 64px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 1.1rem/1.6 var(--f-ml); resize: vertical; }
.fill-open-box .fill-open { flex-basis: 100%; margin: 0; }

/* Songs: groups, tunes, repeat-after-me, videos, class songs */
.song-group { margin-top: 26px; }
.song-group-note { margin: 4px 0 0; font-size: .92rem; }
.song-group .song-sections { margin-top: 12px; }
.song-staff { margin: 14px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.song-tune { margin: 14px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--gold-soft); color: var(--ink); font-size: .95rem; }
.song-note { min-height: 1.5em; margin: 0 0 8px; font-weight: 700; color: var(--teal-deep); }
.song-line.is-your-turn { background: var(--leaf-soft); box-shadow: inset 4px 0 0 var(--leaf); }
.song-video { display: grid; gap: 10px; margin: 0 0 16px; }
.song-video:empty { display: none; }
.song-video-btn { position: relative; display: block; width: min(560px, 100%); aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 18px; overflow: hidden; cursor: pointer; background: #000; }
.song-video-btn img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.song-video-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: #C4302B; color: #fff; font-weight: 800; font-size: 1.05rem; }
.song-video-frame { width: min(720px, 100%); aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; }
.song-video-frame iframe { width: 100%; height: 100%; border: 0; }
.song-video-edit { padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--line-2); background: var(--surface); }
.song-video-edit summary { cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.song-video-edit .muted { font-size: .88rem; }
.song-video-row { display: flex; gap: 8px; flex-wrap: wrap; }
.song-video-input { flex: 1 1 260px; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; }
.song-form { display: grid; gap: 12px; padding: 16px 20px 20px; }
.song-form .field { display: grid; gap: 4px; font-weight: 600; }
.song-form input:not([type=checkbox]), .song-form textarea { min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; }
.song-form textarea.ml, .song-form input.ml { font-family: var(--f-ml); font-size: 1.1rem; }
.song-form .check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.song-form .check input { margin-top: 4px; width: 20px; height: 20px; }

/* Blocks written for our own book: conversations, songs, pictures, word pictures */
.pp-dialog { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.pp-dl { display: grid; grid-template-columns: minmax(64px, 110px) 1fr; gap: 10px; align-items: start; }
.pp-dl-who { display: grid; font-weight: 800; color: var(--red); font-size: .95rem; padding-top: 6px; }
.pp-dl-who .en { font-weight: 600; font-size: .75rem; color: var(--ink-3); }
.pp-song { margin: 6px 0; padding: 16px 18px; border-radius: 20px; background: linear-gradient(160deg, var(--gold-soft), var(--surface)); border: 1px solid var(--line); }
.pp-song-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.pp-song-lines { display: grid; gap: 2px; }
.pp-song-line .rt-line { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; line-height: 1.6; }
.pp-pic { margin: 8px 0; display: grid; justify-items: center; gap: 4px; }
.pp-pic-emoji { font-size: clamp(3rem, 2.4rem + 3vw, 4.5rem); line-height: 1.1; }
.pp-pic figcaption { font-size: .9rem; color: var(--ink-2); text-align: center; }
.pp-word-pic { font-size: 1.6rem; line-height: 1.1; }
.pp-say-by { font-size: .88rem; color: var(--ink-2); }
@media (max-width: 480px) { .pp-dl { grid-template-columns: 1fr; gap: 2px; } .pp-dl-who { padding-top: 0; } }
