/* layout: white top bar; illustrated sky banner; white rounded cards on a pale sky ground */
:root {
  --bg: #eef5fb;
  --surface: #ffffff;
  --ink: #1b2433;
  --muted: #667085;
  --line: #e4ebf3;
  --sky: #00a7d1;          /* flag turquoise */
  --blue: #0a72a8;         /* text-safe sky */
  --blue-dark: #075a85;
  --sky-soft: #e0f3fa;
  --sun: #ffc21a;
  --sun-soft: #fff3c4;
  --coral: #ff6b5b;
  --coral-soft: #ffe8e5;
  --grass: #2fa865;
  --grass-soft: #e2f5ea;
  --berry: #8b5cf6;
  --berry-soft: #efe9fe;
  --danger: #d9443a;
  --radius: 22px;
  --display: "Rubik", "Nunito", system-ui, sans-serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; font-family: var(--display); }
h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 1.02rem; font-weight: 600; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.big { font-size: 1.12rem; }
.accent { color: var(--blue); font-family: var(--display); font-weight: 700; font-size: 1.15em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── top bar ───────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-row { max-width: 1200px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { width: 40px; height: 40px; flex: none; }
.logo.big { width: 72px; height: 72px; }
.brand-text { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.nav { display: flex; gap: 6px; margin: 0 auto; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.nav a:hover { color: var(--ink); background: var(--bg); }
.nav a.on { background: var(--sky-soft); color: var(--blue); }
.top-side { display: flex; align-items: center; gap: 10px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.lang { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg); font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.lang a { text-decoration: none; padding: 5px 12px; border-radius: 999px; color: var(--muted); }
.lang a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(27, 36, 51, .12); }
.main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 72px; }

@media (max-width: 860px) {
  .top-row { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .top-side { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0; }
  .nav a { flex: 1; justify-content: center; padding: 8px 6px; font-size: .9rem; white-space: nowrap; }
  .main { padding: 20px 16px 56px; }
}
@media (max-width: 420px) { .nav a .i { display: none; } .brand-text { font-size: 1rem; } }

/* ── controls ──────────────────────────────────────────────────────────── */
button { font: inherit; cursor: pointer; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 700; white-space: nowrap; }
.link:hover { text-decoration: underline; }
/* chunky "pressable" buttons, like a toy key */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 14px; border: 2px solid transparent; font-family: var(--display); font-weight: 600; font-size: .95rem; text-decoration: none; line-height: 1; white-space: nowrap; transition: transform .08s, box-shadow .08s, background .15s; }
.btn.primary { background: var(--sky); color: #fff; box-shadow: 0 4px 0 var(--blue-dark); }
.btn.primary:hover { background: #0a9cc4; }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-dark); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.btn.ghost:hover { background: #f7fafd; }
.btn.ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; height: 52px; font-size: 1.05rem; }
.btn:focus-visible, .link:focus-visible, .nav a:focus-visible, .chips a:focus-visible, .card:focus-visible, .roster a:focus-visible { outline: 3px solid rgba(0, 167, 209, .45); outline-offset: 2px; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

input, textarea { font: inherit; color: inherit; width: 100%; padding: 11px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
input:hover, textarea:hover { border-color: #d3dde9; }
input:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(0, 167, 209, .15); }
input:disabled { background: var(--bg); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; padding: 0; accent-color: var(--sky); }
input[type=file] { padding: 9px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 700; margin-right: 12px; padding: 7px 14px; border: 0; border-radius: 10px; background: var(--sky-soft); color: var(--blue); cursor: pointer; }
label { display: block; font-weight: 700; font-size: .92rem; }
label > input, label > textarea { margin-top: 6px; font-weight: 400; font-size: 1rem; }
label small { display: block; font-weight: 400; margin-top: 6px; }
label.inline { display: flex; align-items: center; gap: 10px; }
label.inline input { margin: 0; width: auto; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: .92rem; margin-bottom: 8px; padding: 0; }

.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.narrow { max-width: 460px; }
.empty { color: var(--muted); padding: 24px 16px; background: var(--bg); border-radius: 16px; text-align: center; margin: 0; }

.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; margin-bottom: 20px; font-weight: 700; }
.flash.ok { background: var(--grass-soft); color: #1d7a47; }
.flash.error { background: var(--coral-soft); color: var(--danger); }

/* ── page furniture ────────────────────────────────────────────────────── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 2.8vw, 2.1rem); letter-spacing: -.015em; }
.main > .page-title { margin-bottom: 24px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .92rem; }
.back .i { width: 16px; height: 16px; }
.back:hover { color: var(--ink); }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.who { display: flex; align-items: center; gap: 16px; }
.who p { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pop { position: relative; }
.pop-body { position: absolute; right: 0; top: calc(100% + 10px); z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; width: min(360px, 86vw); flex-wrap: nowrap; box-shadow: 0 18px 40px -12px rgba(27, 36, 51, .25); }

.card-box { background: var(--surface); border-radius: var(--radius); padding: 24px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cols.wide-left { grid-template-columns: minmax(0, 1fr) 360px; }
.cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.side-col { display: grid; gap: 24px; }
.sticky { position: sticky; top: 88px; }
@media (max-width: 760px) { .cols.even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 980px) { .cols, .cols.wide-left { grid-template-columns: minmax(0, 1fr); } .sticky { position: static; } }
@media (max-width: 520px) { .card-box { padding: 18px; border-radius: 18px; } }

/* avatars: bright initial discs */
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-family: var(--display); font-weight: 700; font-size: 1rem; flex: none; text-transform: uppercase; color: #fff; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.8rem; }
.a0 { background: var(--sky); }
.a1 { background: var(--berry); }
.a2 { background: var(--coral); }
.a3 { background: var(--grass); }
.a4 { background: #f2a700; }
.a5 { background: #ec5fa6; }

/* reading levels */
.lvl { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-family: var(--sans); font-size: .72rem; font-weight: 800; letter-spacing: .02em; vertical-align: middle; white-space: nowrap; }
.lvl.l1 { background: var(--sun-soft); color: #9a6a00; }
.lvl.l2 { background: var(--coral-soft); color: #c23b2d; }
.lvl.l3 { background: var(--grass-soft); color: #1d7a47; }
.lvl.l4 { background: var(--sky-soft); color: var(--blue); }
.lvl.l5 { background: var(--berry-soft); color: #6d3fd6; }
.ladder { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.ladder li { display: flex; justify-content: space-between; align-items: center; }
.ladder small { color: var(--muted); font-weight: 600; }

/* ── dashboard hero ────────────────────────────────────────────────────── */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: end; gap: 12px; margin-bottom: 24px; border-radius: 28px; overflow: hidden; background: linear-gradient(180deg, #bfe9f7 0%, #e6f7fc 100%); }
.hero-text { padding: 32px 36px 36px; align-self: center; }
.hello { margin: 0 0 8px; font-weight: 800; color: var(--blue); }
.hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; }
.hero-sub { margin: 10px 0 0; font-size: 1.12rem; font-weight: 700; }
.hero-facts { margin: 16px 0 0; color: #3f5a73; font-weight: 600; }
.steppe { display: block; width: 100%; height: auto; }
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-text { padding: 24px 20px 0; }
  .hero .steppe { max-height: 170px; }
}

.roster { list-style: none; padding: 0; margin: 0 -10px; }
.roster a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; text-decoration: none; transition: background .15s; }
.roster a:hover { background: var(--bg); }
.rank { width: 26px; text-align: center; font-family: var(--display); font-weight: 700; font-size: .9rem; color: #9aa6b5; font-variant-numeric: tabular-nums; flex: none; }
.rank.r1, .rank.r2, .rank.r3 { display: grid; place-items: center; height: 26px; border-radius: 50%; color: #fff; font-size: .8rem; }
.rank.r1 { background: var(--sun); color: #6b4a00; }
.rank.r2 { background: #b6c2d1; }
.rank.r3 { background: #e0955a; }
.roster-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.roster-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; border-radius: 99px; background: #edf2f7; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--sky); background-image: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255, 255, 255, .22) 6px 12px); }
.roster-num { display: flex; flex-direction: column; align-items: flex-end; min-width: 76px; }
.roster-num b { font-family: var(--display); font-size: 1.3rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.roster-num small { font-size: .75rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) { .roster .lvl { display: none; } .roster a { gap: 10px; } }

.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: flex; gap: 12px; align-items: center; padding: 9px 0; }
.feed li + li { border-top: 1px solid var(--line); }
.feed li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.feed li > div a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed li > div .muted { font-size: .88rem; }
.feed time { font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; background: var(--sky-soft); color: var(--blue); font-size: .76rem; font-weight: 800; white-space: nowrap; }

/* ── student progress ──────────────────────────────────────────────────── */
.progress { margin-bottom: 24px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.steps::before { content: ""; position: absolute; top: 21px; left: 10%; right: 10%; height: 4px; border-radius: 4px; background: var(--line); }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.steps span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); font-family: var(--display); font-weight: 700; color: #9aa6b5; }
.steps small { font-weight: 800; font-size: .82rem; color: var(--muted); }
.steps .done span { color: #fff; border-color: transparent; }
.steps .done.l1 span { background: var(--sun); color: #6b4a00; }
.steps .done.l2 span { background: var(--coral); }
.steps .done.l3 span { background: var(--grass); }
.steps .done.l4 span { background: var(--sky); }
.steps .done.l5 span { background: var(--berry); }
.steps .now span { transform: scale(1.15); box-shadow: 0 0 0 6px var(--sun-soft); }
.steps .done small { color: var(--ink); }
.progress-note { margin: 18px 0 0; text-align: center; font-weight: 700; font-family: var(--display); }
@media (max-width: 520px) { .steps span { width: 36px; height: 36px; font-size: .85rem; } .steps::before { top: 16px; } .steps small { font-size: .7rem; } }

/* ── covers ────────────────────────────────────────────────────────────── */
.cover { --c: var(--sky); position: relative; aspect-ratio: 3 / 4; max-width: 100%; border-radius: 14px; overflow: hidden; color: #fff; background: var(--c); box-shadow: 0 2px 0 rgba(27, 36, 51, .06), 0 14px 24px -14px rgba(27, 36, 51, .45); }
.cover.cat-ertegi { --c: var(--berry); }
.cover.cat-olen { --c: var(--coral); }
.cover.cat-angime { --c: var(--grass); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.cover-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 1rem; line-height: 1.2; text-wrap: balance; }
.cover-fallback svg { width: 56px; height: 56px; color: rgba(255, 255, 255, .9); }
.cover-fallback svg[viewBox="0 0 48 24"] { height: 28px; }
.cover.xs { width: 42px; flex: none; border-radius: 8px; }
.cover.xs .cover-fallback { padding: 0; }
.cover.xs .cover-fallback span { display: none; }
.cover.xs .cover-fallback svg { width: 26px; height: 26px; }
.cover.xs .cover-fallback svg[viewBox="0 0 48 24"] { height: 13px; }
.cover.lg { width: 100%; max-width: 320px; border-radius: 22px; }
.cover.lg .cover-fallback { font-size: 1.5rem; padding: 28px; }
.cover.lg .cover-fallback svg { width: 96px; height: 96px; }
.cover.lg .cover-fallback svg[viewBox="0 0 48 24"] { height: 48px; }

/* ── library ───────────────────────────────────────────────────────────── */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 28px; }
.search { position: relative; flex: 1 1 280px; max-width: 400px; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { margin: 0; padding-left: 44px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a, .chips label span { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 800; font-size: .92rem; color: var(--muted); cursor: pointer; transition: all .15s; }
.chips a:hover, .chips label span:hover { color: var(--ink); border-color: #d3dde9; }
.chips a.on, .chips input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips label { display: inline-block; position: relative; }
.chips label input { position: absolute; opacity: 0; }
.chips label input:focus-visible + span { outline: 3px solid rgba(0, 167, 209, .45); outline-offset: 2px; }
.chips legend { width: 100%; }
.chips .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.cat-ertegi { background: var(--berry); }
.dot.cat-olen { background: var(--coral); }
.dot.cat-angime { background: var(--grass); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 32px 22px; }
.card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; border-radius: 14px; }
.card .cover { margin-bottom: 10px; transition: transform .2s ease; }
.card:hover .cover { transform: translateY(-4px) rotate(-1deg); }
.card-title { font-family: var(--display); font-weight: 600; line-height: 1.25; }
.card-author { font-size: .88rem; }
.card .pill { align-self: flex-start; margin-top: 6px; }
.tag { align-self: flex-start; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; background: var(--sky-soft); color: var(--blue); }
.tag.cat-ertegi { background: var(--berry-soft); color: #6d3fd6; }
.tag.cat-olen { background: var(--coral-soft); color: #c23b2d; }
.tag.cat-angime { background: var(--grass-soft); color: #1d7a47; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; } }

/* ── book page ─────────────────────────────────────────────────────────── */
.book { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 44px; align-items: start; }
.book-info .page-title { margin: 12px 0 6px; font-size: clamp(1.7rem, 3.2vw, 2.6rem); }
.book-info > .big { margin: 0 0 22px; }
.book-info > .small { margin: 14px 0 0; }
@media (max-width: 860px) { .book { grid-template-columns: minmax(0, 1fr); gap: 24px; } .book-cover .cover.lg { max-width: 220px; } }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 99px; background: var(--sun); color: #6b4a00; font-size: .8rem; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.plain-list li + li { border-top: 1px solid var(--line); }
.plain-list li a { flex: 1; font-weight: 700; text-decoration: none; }
.plain-list li a:hover { color: var(--blue); }
.plain-list time { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.x { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: #9aa6b5; }
.x .i { width: 16px; height: 16px; }
.x:hover { background: var(--coral-soft); color: var(--danger); }

.checklist { max-height: 340px; overflow: auto; border: 2px solid var(--line); border-radius: 16px; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; font-weight: 600; font-size: .95rem; cursor: pointer; transition: background .1s; }
.checklist label + label { border-top: 1px solid var(--line); }
.checklist label:hover { background: var(--bg); }
.checklist input { margin-top: 1px; }
.checklist small { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
.checklist label:has(input:checked) { background: var(--sky-soft); }

/* ── student shelf ─────────────────────────────────────────────────────── */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 26px 18px; }
.shelf-item { display: flex; flex-direction: column; gap: 6px; }
.shelf-title { font-family: var(--display); font-weight: 600; text-decoration: none; line-height: 1.25; font-size: .95rem; }
.shelf-meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); }
.shelf-meta .x { width: 28px; height: 28px; }

/* ── book form ─────────────────────────────────────────────────────────── */
.book-form { display: grid; grid-template-columns: minmax(0, 560px) 240px; gap: 32px; align-items: start; margin-top: 24px; }
.preview { position: sticky; top: 88px; }
@media (max-width: 860px) { .book-form { grid-template-columns: minmax(0, 1fr); } .preview { display: none; } }

/* ── login ─────────────────────────────────────────────────────────────── */
.login { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; }
.login-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: linear-gradient(180deg, #8fd8f0 0%, #d5f1fa 70%); }
.login-art-body { padding: 56px 56px 0; }
.login-art h1 { margin: 24px 0 10px; font-weight: 800; font-size: clamp(2.2rem, 4.6vw, 3.8rem); letter-spacing: -.03em; line-height: 1.02; max-width: 12ch; }
.login-art p { margin: 0; font-weight: 700; color: #2f5873; }
.login-form { position: relative; display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-form .lang { position: absolute; top: 24px; right: 24px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 1.6rem; margin: 0; display: block; }
.login-box > p { margin-top: 8px; }
@media (max-width: 860px) {
  .login { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .login-art-body { padding: 28px 20px 0; }
  .login-art .logo.big { width: 52px; height: 52px; }
  .login-art h1 { font-size: 2rem; margin-top: 14px; }
  .login-art .steppe { max-height: 180px; }
  .login-form { padding: 64px 16px 48px; }
  .login-form .lang { top: 16px; right: 16px; }
}

/* ── page progress ─────────────────────────────────────────────────────── */
.prog { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prog-bar { flex: 1; height: 10px; border-radius: 99px; background: #edf2f7; overflow: hidden; }
.prog-bar i { display: block; height: 100%; border-radius: 99px; background: var(--sun); }
.prog.full .prog-bar i { background: var(--grass); }
.prog-num { font-size: .8rem; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed .prog { margin-top: 6px; }
.hero-pages { margin: 6px 0 0; font-weight: 700; color: #3f5a73; }

.reading { list-style: none; padding: 0; margin: 0; }
.reading li { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; }
.reading li + li { border-top: 1px solid var(--line); }
.cover.sm { width: 64px; flex: none; border-radius: 10px; }
.cover.sm .cover-fallback span { display: none; }
.cover.sm .cover-fallback svg { width: 32px; height: 32px; }
.reading-main { flex: 1; min-width: 0; display: grid; gap: 10px; }
.reading-title { font-family: var(--display); font-weight: 600; text-decoration: none; }
.reading-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reading-form label { font-size: .85rem; }
.reading-form input { width: 90px; padding: 8px 10px; }
.log { list-style: none; padding: 0; margin: 0; }
.log li + li { border-top: 1px solid var(--line); }
.log summary { display: flex; gap: 6px 16px; align-items: center; padding: 12px 8px; margin: 0 -8px; border-radius: 12px; cursor: pointer; list-style: none; }
.log summary::-webkit-details-marker { display: none; }
.log summary:hover { background: var(--bg); }
.log time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.log-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-delta { color: var(--blue); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-edit { font-size: .82rem; color: var(--muted); }
.log details[open] .log-edit { visibility: hidden; }
.log details form { padding: 4px 0 14px; }
@media (max-width: 520px) { .log-edit { display: none; } }
.small-btn { height: 38px; padding: 0 14px; font-size: .88rem; }
.reader { flex: 1; min-width: 0; display: grid; gap: 6px; }

/* ── card headers & marking footer (book page, student aside) ──────────── */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.stack > .card-head + * { margin-top: 0; }
.chip-btn { flex: none; margin-block: -6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--sky-soft); color: var(--blue); font-weight: 800; font-size: .85rem; white-space: nowrap; }
.chip-btn:hover { background: #cdebf6; }
.chip-btn:focus-visible { outline: 3px solid rgba(0, 167, 209, .45); outline-offset: 2px; }
/* ── book picker modal ─────────────────────────────────────────────────── */
.modal { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 24px; background: var(--surface); color: var(--ink); }
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(27, 36, 51, .5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.modal-head h2 { margin: 0; }
.modal > input[type=search] { margin: 14px 20px; width: auto; }
.pick-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 20px 16px; padding: 4px 20px 20px; }
.pick { position: relative; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.pick[hidden] { display: none; }
.pick input { position: absolute; top: 8px; left: 8px; z-index: 1; width: 22px; height: 22px; }
.pick .cover { margin-bottom: 4px; outline: 3px solid transparent; outline-offset: 2px; transition: outline-color .1s, transform .1s; }
.pick:hover .cover { transform: translateY(-2px); }
.pick:has(input:checked) .cover { outline-color: var(--sky); }
.pick-title { font-family: var(--display); font-weight: 600; font-size: .9rem; line-height: 1.25; }
.pick small { font-size: .8rem; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; justify-content: space-between; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.modal-foot .two-btn { flex: 1; max-width: 420px; }
@media (max-width: 600px) { .pick-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px 10px; } .modal-foot .two-btn { max-width: none; } }
.modal-sm { width: min(480px, calc(100vw - 32px)); }
.modal-body { padding: 18px 20px 20px; }
.modal-body .modal-head { padding: 0; }
.modal-body .btn { width: 100%; }
.hero-cta { margin-top: 20px; }

/* ── today: the whole class's pages on one form ────────────────────────── */
.today-list { list-style: none; padding: 0; margin: 16px 0 0; }
.today-list li { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 10px 0; }
.today-list li.first:not(:first-child) { border-top: 1px solid var(--line); }
.today-who { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.today-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-book { display: flex; gap: 12px; align-items: center; min-width: 0; }
a.today-book { grid-column: span 2; font-size: .9rem; }
.today-page { display: flex; align-items: center; gap: 8px; font-size: .85rem; white-space: nowrap; }
.today-page input { width: 90px; padding: 8px 10px; }
.today-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; margin: 8px -4px 0; padding: 14px 4px 4px; background: var(--surface); border-top: 1px solid var(--line); }
@media (max-width: 700px) {
  .today-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .today-who { grid-column: 1 / -1; }
  .today-who:empty, .today-page span { display: none; }
  .today-page input { width: 76px; }
  a.today-book { grid-column: 1 / -1; }
  .today-foot .btn { width: 100%; }
}
.mark-foot { display: grid; gap: 14px; margin-top: 16px; }
.mark-foot input[type=date] { width: 100%; }
.two-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-btn .btn { width: 100%; padding: 0 10px; }
@media (max-width: 380px) { .two-btn { grid-template-columns: minmax(0, 1fr); } }
.book-lists { margin-top: 32px; }
.reader-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.reader-top a { font-weight: 700; text-decoration: none; }
.reader-top a:hover { color: var(--blue); }
.reader-top time { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
