/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --page-w: 480px;
  --page-h: 644px;
  --pad-top: 44px;
  --pad-bottom: 40px;
  --pad-left: 64px;
  --pad-right: 28px;
  --line: 28px;
  --paper: #fdfcf6;
  --paper-2: #f6f2e6;
  --rule: #b9d3ea;
  --rule-red: #e08a8a;
  --ink: #23324a;
  --ink-blue: #1d3f9e;
  --ink-red: #c2262e;
  --pencil: #6b6b6b;
  --desk: #5e4630;
  --desk-2: #7a5b3c;
  --cover: #2f6b3a;
  --cover-2: #24552e;
  --sticker: #fff3a6;
  --font-hand: "Caveat", "Segoe Script", cursive;
  --font-mark: "Marck Script", "Caveat", cursive;
  --font-ui: "PT Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "PT Serif", Georgia, serif;
  --font-child: "Neucha", "Caveat", cursive;
  /* бумажное зерно и тканевое переплетение — data-URI, без внешних запросов */
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  --cloth-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--desk);
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #6a4f35, #4e3926);
  overflow-x: hidden;
}
.sr { position: absolute; left: -9999px; }
.muted { opacity: .7; font-weight: 400; }

/* ---------- chrome ---------- */
.desk { min-height: 100vh; display: flex; flex-direction: column; padding-inline: 16px; }
.topbar, .bottombar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: #f4e9d8; padding-block: 10px; font-size: 14px;
}
.brand { font-family: var(--font-serif); font-size: 18px; font-weight: 700; }
.bell { display: inline-block; animation: swing 3s ease-in-out infinite; transform-origin: top center; }
@keyframes swing { 0%,100% { transform: rotate(-8deg);} 50% { transform: rotate(8deg);} }
.jumps { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.jumps button, .jumps select {
  font: inherit; color: #f4e9d8; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px; padding: 5px 10px; cursor: pointer;
}
.jumps button:hover { background: rgba(0,0,0,.4); }
.jumps select { max-width: 180px; }
.bottombar { justify-content: center; gap: 24px; font-size: 13px; opacity: .85; }
.hint { display: none; }
@media (min-width: 700px) { .hint { display: inline; } }

.stage { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; position: relative; padding-block: 8px; }
.arrow {
  font: 700 40px/1 var(--font-serif); color: #f4e9d8; background: rgba(0,0,0,.25); border: 0; border-radius: 50%;
  width: 52px; height: 52px; cursor: pointer; flex: none; z-index: 5; transition: background .2s, opacity .2s;
}
.arrow:hover { background: rgba(0,0,0,.45); }
.arrow[disabled] { opacity: .25; cursor: default; }
@media (max-width: 700px) { .arrow { position: absolute; bottom: 8px; width: 44px; height: 44px; font-size: 32px; } .arrow-left { left: 8px; } .arrow-right { right: 8px; } }

/* ---------- book geometry ---------- */
.book-wrap { position: relative; flex: none; }
.book {
  position: absolute; left: 0; top: 0; transform-origin: top left;
  width: calc(var(--page-w) * 2); height: var(--page-h);
  perspective: 2200px;
}
.book.single { width: var(--page-w); }
.leaf { position: absolute; top: 0; width: var(--page-w); height: var(--page-h); }
.leaf-left { left: 0; }
.leaf-right { left: var(--page-w); }
.book.single .leaf-right { left: 0; }
.book.single .leaf-left { display: none; }
.leaf > .page { position: absolute; inset: 0; }
.leaf-left > .page { border-radius: 7px 0 0 7px; box-shadow: -6px 6px 18px rgba(0,0,0,.35); }
.leaf-right > .page { border-radius: 0 7px 7px 0; box-shadow: 6px 6px 18px rgba(0,0,0,.35); }
.book.single .leaf-right > .page { border-radius: 7px; }

/* толщина книжного блока: стопка листов по внешним краям */
.book::before, .book::after {
  content: ""; position: absolute; top: 6px; bottom: 6px; width: 9px; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, #efeade 0 2px, #d9d2bf 2px 3px);
  box-shadow: 0 6px 14px rgba(0,0,0,.3);
}
.book::before { left: -9px; border-radius: 5px 0 0 5px; }
.book::after { right: -9px; border-radius: 0 5px 5px 0; }
.book.single::before, .book.no-left::before { display: none; }
/* корешок с прошивкой */
.book .spine {
  position: absolute; left: calc(var(--page-w) - 13px); top: 0; width: 26px; height: 100%; z-index: 4; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.16), rgba(0,0,0,.03) 42%, rgba(255,255,255,.35) 50%, rgba(0,0,0,.03) 58%, rgba(0,0,0,.16));
}
.book .spine::after {
  content: ""; position: absolute; left: 50%; top: 34px; bottom: 34px; width: 2px; transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, rgba(90,70,45,.5) 0 9px, transparent 9px 19px);
}
.book.single .spine { display: none; }
.leaf-left > .page::after, .leaf-right > .page::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 46px; pointer-events: none;
}
.leaf-left > .page::after { right: 0; background: linear-gradient(90deg, transparent, rgba(0,0,0,.10)); }
.leaf-right > .page::after { left: 0; background: linear-gradient(270deg, transparent, rgba(0,0,0,.12)); }
.book.single .leaf-right > .page::after { display: none; }

/* flipping sheet */
.flipper {
  position: absolute; top: 0; width: var(--page-w); height: var(--page-h);
  transform-style: preserve-3d; transition: transform .9s cubic-bezier(.4,.05,.3,1); z-index: 10; will-change: transform;
}
.flipper.fwd { left: var(--page-w); transform-origin: left center; }
.flipper.bwd { left: 0; transform-origin: right center; }
.book.single .flipper.fwd { left: 0; }
.flipper .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flipper .face > .page { position: absolute; inset: 0; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.flipper .back { transform: rotateY(180deg); }
.flipper .face::after { content: ""; position: absolute; inset: 0; pointer-events: none; transition: opacity .9s; opacity: 0; background: linear-gradient(90deg, rgba(0,0,0,.25), transparent 60%); }
.flipper.turning .face::after { opacity: 1; }
.flipper.fwd.turning { transform: rotateY(-180deg); }
.flipper.bwd.turning { transform: rotateY(180deg); }

/* click zones on page edges */
.leaf .edge { position: absolute; top: 0; bottom: 0; width: 60px; cursor: pointer; z-index: 3; }
.leaf-left .edge { left: 0; }
.leaf-right .edge { right: 0; }
.leaf .edge:hover { background: linear-gradient(90deg, rgba(0,0,0,.04), transparent); }
.leaf-right .edge:hover { background: linear-gradient(270deg, rgba(0,0,0,.05), transparent); }
.leaf-right .edge::after { content: ""; position: absolute; right: 0; bottom: 0; border-style: solid; border-width: 0 0 26px 26px; border-color: transparent transparent rgba(0,0,0,.08) transparent; }
.leaf-left .edge::after { content: ""; position: absolute; left: 0; bottom: 0; border-style: solid; border-width: 26px 0 0 26px; border-color: transparent transparent transparent rgba(0,0,0,.08); }

/* ---------- pages ---------- */
.page {
  width: var(--page-w); height: var(--page-h); overflow: hidden; background: var(--paper); color: var(--ink);
  font-family: var(--font-hand); font-size: 19.5px; line-height: var(--line);
}
.page-paper {
  background-color: var(--paper);
  background-image:
    var(--paper-grain),
    linear-gradient(90deg, transparent calc(var(--pad-left) - 10px), var(--rule-red) calc(var(--pad-left) - 10px), var(--rule-red) calc(var(--pad-left) - 8px), transparent calc(var(--pad-left) - 8px)),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  background-origin: padding-box, content-box, content-box;
  background-position: 0 0, 0 0, 0 var(--pad-top);
}
/* дырки от скоросшивателя на левом поле */
.page-paper.pupil::before {
  content: ""; position: absolute; left: 16px; top: 96px; width: 13px; height: 13px; border-radius: 50%;
  background: #e7e3d6; box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 196px 0 #e7e3d6, 0 196px 0 1px rgba(0,0,0,.05), 0 392px 0 #e7e3d6, 0 1px 0 1px rgba(0,0,0,.05), 0 392px 0 1px rgba(0,0,0,.05);
  z-index: 2;
}
.page-grid {
  background-color: var(--paper);
  background-image:
    var(--paper-grain),
    repeating-linear-gradient(90deg, transparent 0 19px, #dbe6f1 19px 20px),
    repeating-linear-gradient(180deg, transparent 0 19px, #dbe6f1 19px 20px);
  font-family: var(--font-ui); font-size: 14px; line-height: 20px;
}
.page-content {
  position: absolute; left: var(--pad-left); right: var(--pad-right); top: var(--pad-top);
  height: calc(var(--page-h) - var(--pad-top) - var(--pad-bottom)); overflow: hidden;
}
.page-grid .page-content { left: 36px; right: 28px; top: 40px; height: calc(var(--page-h) - 80px); }
.page-foot { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font: 12px/1 var(--font-ui); color: var(--pencil); }
.page-head { position: absolute; top: 12px; left: var(--pad-left); right: var(--pad-right); font: italic 12px/1 var(--font-ui); color: var(--pencil); display: flex; justify-content: space-between; }
.page-grid .page-head { left: 36px; right: 28px; }

.measure { position: absolute; left: -5000px; top: 0; visibility: hidden; pointer-events: none; }
.measure .page-content { overflow: hidden; height: auto; }

/* essay typography (sits on the ruled lines) */
.page-content > * { margin: 0; }
.page-content p, .page-content li { margin: 0 0 0; }
.page-content p + p { text-indent: 1.6em; }
.page-content p.cont, .page-content .cont-note + p { text-indent: 0; }
.page-content h2, .page-content h3, .page-content h4 { font-family: var(--font-hand); font-weight: 700; font-size: 22px; line-height: var(--line); margin: 0; color: var(--ink-blue); }
.page-content h2 { font-size: 24px; }
.page-content ul, .page-content ol { padding-left: 1.4em; margin: 0; }
.page-content code { font: 13px/1 "SFMono-Regular", Menlo, Consolas, monospace; background: rgba(29,63,158,.07); padding: 1px 4px; border-radius: 3px; }
.page-content pre { font: 11px/14px "SFMono-Regular", Menlo, Consolas, monospace; background: #eef2f6; padding: 8px; border-radius: 4px; overflow-x: auto; white-space: pre; margin: 4px 0; }
.page-content blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--rule-red); font-style: italic; }
.page-content hr { border: 0; border-top: 1px dashed var(--pencil); margin: 8px 0; }
.page-content a { color: var(--ink-blue); }
.tbl { overflow-x: auto; margin: 4px 0; font-family: var(--font-ui); font-size: 12px; line-height: 16px; }
.tbl table { border-collapse: collapse; }
.tbl th, .tbl td { border: 1px solid #c9d3de; padding: 3px 6px; text-align: left; vertical-align: top; }
.tbl th { background: #eef2f6; }

/* essay head */
.essay-head { text-align: center; margin-bottom: var(--line); }
.essay-head .t1 { font: 700 26px/var(--line) var(--font-hand); color: var(--ink-blue); }
.essay-head .t2 { font: 19px/var(--line) var(--font-hand); }
.essay-head .t2 b { font-weight: 700; }
.essay-head .t3 { font: 12px/var(--line) var(--font-ui); color: var(--pencil); }
.essay-title { font: 700 24px/var(--line) var(--font-hand); text-align: center; }
.cont-note { font: italic 12px/var(--line) var(--font-ui); color: var(--pencil); }

/* teacher's red pen */
.teacher { position: relative; margin-top: 14px; padding: 8px 8px 4px 88px; min-height: 84px; font-family: var(--font-mark); color: var(--ink-red); font-size: 20px; line-height: 26px; transform: rotate(-1.2deg); }
.teacher .grade {
  position: absolute; left: 0; top: 0; width: 76px; height: 76px; border: 3px solid var(--ink-red); border-radius: 50% 48% 52% 50% / 52% 50% 50% 48%;
  display: flex; align-items: center; justify-content: center; font: 700 44px/1 var(--font-mark); color: var(--ink-red); transform: rotate(-8deg);
}
.teacher .grade.small { font-size: 18px; line-height: 1.05; text-align: center; }
.teacher .grade-label { font: 12px/1 var(--font-ui); color: var(--pencil); position: absolute; left: 0; top: 80px; width: 76px; text-align: center; }
.teacher.na .grade { border-style: dashed; }
.teacher .points { display: block; font: 13px/1.2 var(--font-ui); color: var(--ink-red); opacity: .8; margin-top: 4px; }

/* pupil's blue insight */
.insight { margin-top: 10px; font-family: var(--font-hand); color: var(--ink-blue); }
.insight .lbl { font-weight: 700; }
.insight.none { color: var(--ink-red); font-family: var(--font-mark); }
.insight .theme { font: 12px/1.2 var(--font-ui); color: var(--pencil); }

/* sticky note about the process */
.sticker {
  margin: 12px 0 0 -10px; padding: 12px 14px; background: var(--sticker); color: #3b3a2a; font: 13px/17px var(--font-ui);
  box-shadow: 2px 4px 10px rgba(0,0,0,.18); transform: rotate(.8deg); position: relative;
}
.sticker::before { content: ""; position: absolute; left: 40%; top: -9px; width: 70px; height: 18px; background: rgba(255,255,255,.55); border: 1px solid rgba(0,0,0,.06); transform: rotate(-3deg); }
.sticker .lbl { font-weight: 700; font-size: 14px; }
.sticker .tag { display: inline-block; background: #fff; border: 1px solid #d8c96a; border-radius: 12px; padding: 0 8px; font-size: 12px; margin-left: 4px; }
.sticker .facts { margin-top: 6px; color: #6b6b6b; font-size: 12px; }
.sticker .flags { margin-top: 4px; }
.sticker .flag { display: inline-block; background: #fbe3e3; color: var(--ink-red); border-radius: 3px; padding: 0 6px; font-size: 11px; margin: 2px 4px 0 0; }
.sticker a { color: var(--ink-blue); }

/* quotes in the journal */
.q { font-style: italic; color: var(--ink); }

/* ---------- cover ---------- */
.page-cover {
  background: var(--cover);
  background-image:
    var(--cloth-grain),
    radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.10), transparent 62%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,.30)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 4px);
  color: #f7f0dc; font-family: var(--font-serif); text-align: center; padding: 34px 30px;
}
.page-cover .frame {
  height: 100%; padding: 20px 18px; display: flex; flex-direction: column; justify-content: space-between; position: relative;
  border: 2px solid transparent;
  border-image: linear-gradient(150deg, #f3e0a6, #b08d3f 35%, #8a6a22 55%, #f3e0a6) 1;
  box-shadow: 0 0 0 1px rgba(240,212,122,.35) inset, 0 0 22px rgba(0,0,0,.25) inset;
}
/* наклейка-шильдик поверх обложки */
.page-cover .plate {
  background: linear-gradient(180deg, #fdfaf0, #f2ecdb); color: #3d3524; border-radius: 2px;
  padding: 12px 14px 14px; margin: 0 auto; width: 100%; text-align: left; position: relative;
  box-shadow: 0 3px 10px rgba(0,0,0,.28); transform: rotate(-.7deg);
}
.page-cover .plate::after { content: ""; position: absolute; right: 0; bottom: 0; border-style: solid; border-width: 0 0 16px 16px; border-color: transparent transparent rgba(0,0,0,.10) transparent; }
.page-cover .kind { font: 700 34px/1.1 var(--font-serif); letter-spacing: .08em; text-transform: uppercase; }
.page-cover .sub { font: italic 18px/1.3 var(--font-serif); margin-top: 6px; }
.page-cover .lines { text-align: left; font: 14px/1.95 var(--font-serif); margin: 0; width: 100%; color: #6b5c3c; }
.page-cover .lines div { border-bottom: 1px solid #d3c9ad; display: flex; gap: 8px; }
.page-cover .lines div:last-child { border-bottom: 0; }
.page-cover .lines span { font-family: var(--font-hand); font-size: 21px; color: var(--ink-blue); }
.page-cover .flowers { font-size: 46px; line-height: 1; letter-spacing: 4px; }
.page-cover .year { font: 700 20px/1 var(--font-serif); }
.page-cover .stamp { position: absolute; right: 12px; top: 12px; border: 2px solid #f0d47a; color: #f0d47a; border-radius: 6px; padding: 4px 8px; font: 700 12px/1.2 var(--font-ui); transform: rotate(8deg); }
.page-cover.back .frame { justify-content: center; }
.page-cover .table { font: 13px/1.5 var(--font-serif); text-align: left; margin: 0 auto; width: 100%; }
.page-cover .table td { padding: 2px 6px; border-bottom: 1px dotted rgba(255,255,255,.3); }
.page-cover .table td:last-child { text-align: right; }
.page-cover .small { font: 12px/1.5 var(--font-ui); opacity: .8; }

/* ---------- journal (TOC) ---------- */
.journal { width: 100%; border-collapse: collapse; font: 12.5px/17px var(--font-ui); }
.journal th { text-align: left; border-bottom: 2px solid var(--ink); padding: 2px 4px; font-weight: 700; }
.journal td { border-bottom: 1px solid #cdd7e1; padding: 0 4px; cursor: pointer; }
.journal tr:hover td { background: rgba(29,63,158,.06); }
.journal .g { font: 700 17px/18px var(--font-mark); color: var(--ink-red); text-align: center; }
.journal .n { color: var(--pencil); }
.journal .lab { color: var(--ink-blue); font-size: 11.5px; }
.journal .nm { font-family: var(--font-hand); font-size: 16px; }
.grid-title { font: 700 22px/28px var(--font-hand); color: var(--ink-blue); margin-bottom: 4px; }
.grid-sub { font: italic 12px/16px var(--font-ui); color: var(--pencil); margin-bottom: 8px; }

/* ---------- council pages ---------- */
.page-grid .page-content h2, .page-grid .page-content h3 { font: 700 20px/24px var(--font-hand); color: var(--ink-blue); margin: 6px 0 2px; }
.page-grid .page-content p, .page-grid .page-content li { font: 13px/18px var(--font-ui); margin: 0 0 6px; }
.page-grid .page-content p + p { text-indent: 0; }
.page-grid .page-content ul { padding-left: 18px; margin: 0 0 6px; }
.page-grid .page-content code { font-size: 12px; }
.page-grid .tbl { font-size: 11.5px; line-height: 15px; }
.bars { font: 13px/18px var(--font-ui); margin-bottom: 8px; }
.bars .row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.bars .g { width: 34px; font: 700 20px/20px var(--font-mark); color: var(--ink-red); text-align: right; }
.bars .bar { height: 14px; background: linear-gradient(90deg, #6aa6e5, #2f6fc4); border-radius: 3px; }
.bars .n { color: var(--pencil); }
.honor { list-style: none; padding: 0; margin: 0; }
.honor li { margin: 0 0 8px; padding-left: 44px; position: relative; }
.honor .g { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border: 2px solid var(--ink-red); border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 18px/1 var(--font-mark); color: var(--ink-red); }
.honor b { cursor: pointer; color: var(--ink-blue); }
.honor .r { font: italic 12.5px/16px var(--font-ui); color: #444; }
.rub { font: 13px/17px var(--font-ui); }
.rub b { color: var(--ink-blue); }
.chips span { display: inline-block; background: #fff; border: 1px solid #c9d3de; border-radius: 12px; padding: 1px 8px; font: 12px/18px var(--font-ui); margin: 2px 4px 2px 0; }

/* assignment page */
.pin { position: absolute; top: 30px; left: 50%; width: 18px; height: 18px; background: radial-gradient(circle at 35% 35%, #ff8a80, #c62828); border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,.35); transform: translateX(-50%); z-index: 2; }
.assignment .page-content { font-family: var(--font-serif); font-size: 12.5px; line-height: 18px; }
.assignment .page-content p, .assignment .page-content li { margin: 0 0 6px; }
.assignment .page-content p + p { text-indent: 0; }
.assignment .page-content h3 { font: 700 18px/22px var(--font-serif); color: var(--ink); margin: 0 0 6px; }
.assignment .page-content ul { padding-left: 20px; margin: 0 0 8px; }
.assignment .sheet { background: #fff; border: 1px solid #ddd; box-shadow: 0 4px 12px rgba(0,0,0,.15); padding: 18px 14px 10px; transform: rotate(-1.2deg); }

/* external card */
.ext-card { background: #fff; border: 1px dashed var(--ink-red); padding: 12px; font: 14px/20px var(--font-ui); margin-top: 20px; }
.ext-card a { display: block; word-break: break-all; color: var(--ink-blue); }

/* decorative leaves on the desk */
.leaves { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.leaf-deco { position: absolute; font-size: 34px; opacity: .55; animation: fall 18s linear infinite; }
.l1 { left: 6%; animation-delay: 0s; } .l2 { left: 24%; animation-delay: -6s; font-size: 26px; } .l3 { left: 72%; animation-delay: -11s; } .l4 { left: 90%; animation-delay: -3s; font-size: 28px; }
@keyframes fall { 0% { transform: translateY(-60px) rotate(0); } 100% { transform: translateY(110vh) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .leaf-deco, .bell { animation: none; } .flipper { transition-duration: .01s; } }
.stage, .topbar, .bottombar { position: relative; z-index: 1; }

/* ---------- похвальная грамота ---------- */
.page-diploma {
  background: #fbf3dd;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.7), transparent 55%),
    repeating-linear-gradient(45deg, rgba(190,160,90,.05) 0 4px, transparent 4px 12px);
  color: #3d3524; font-family: var(--font-serif); text-align: center; padding: 20px;
}
.dp-frame {
  height: 100%; border: 3px double #b08d3f; outline: 1px solid #d8c18a; outline-offset: 5px;
  padding: 22px 26px 18px; display: flex; flex-direction: column; align-items: center; position: relative;
}
.dp-ribbon { font-size: 34px; line-height: 1; margin-bottom: 2px; }
.dp-kind { font: 700 27px/1.15 var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: #8a6a22; }
.dp-rule { width: 72%; height: 1px; background: linear-gradient(90deg, transparent, #b08d3f, transparent); margin: 9px 0 11px; }
.dp-award { font: italic 14px/1.3 var(--font-serif); color: #6b5c3c; }
.dp-name { font: 700 40px/1.15 var(--font-mark); color: var(--ink-blue); margin: 4px 0 8px; }
.dp-nom { font: 700 17px/1.25 var(--font-serif); color: #8a6a22; }
.dp-sub { font: italic 13.5px/1.35 var(--font-serif); color: #6b5c3c; margin-top: 4px; }
.dp-lead { font: 13px/19px var(--font-ui); text-align: left; margin-top: 14px; color: #4a422f; }
.dp-foot { margin-top: auto; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 12px; }
.dp-sign { font: italic 12px/1.5 var(--font-serif); color: #6b5c3c; text-align: left; border-top: 1px solid #c9b47e; padding-top: 4px; min-width: 160px; }
.dp-seal {
  width: 92px; height: 92px; flex: none; border: 2px solid var(--ink-red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--ink-red);
  font: 11px/1.35 var(--font-ui); text-transform: uppercase; letter-spacing: .04em;
  transform: rotate(-9deg); opacity: .85; box-shadow: inset 0 0 0 4px rgba(194,38,46,.12);
}
.dp-seal b { display: block; font: 700 26px/1.1 var(--font-mark); letter-spacing: 0; }
.dp-links { margin-top: 10px; font: 12.5px/1.4 var(--font-ui); color: #6b5c3c; }
.dp-links b { color: var(--ink-blue); cursor: pointer; border-bottom: 1px dotted var(--ink-blue); font-weight: 400; }

/* ---------- выписка: практики и чек-лист ---------- */
.page-grid .page-content .practice { margin: 8px 0 2px; }
.pr-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pr-n { flex: none; width: 19px; height: 19px; border-radius: 50%; background: var(--ink-blue); color: #fff; font: 700 12px/19px var(--font-ui); text-align: center; }
.pr-stage { background: #e7eefb; color: var(--ink-blue); border-radius: 10px; padding: 1px 8px; font: 700 11px/16px var(--font-ui); text-transform: uppercase; letter-spacing: .03em; }
.pr-title { font: 700 14.5px/19px var(--font-ui); }
.page-grid .page-content p.pr-text { margin: 2px 0 8px 25px; }
.page-grid .page-content ol.checklist { padding-left: 22px; margin: 0 0 8px; }
.page-grid .page-content ol.checklist li { margin-bottom: 5px; }
.page-grid .page-content ul.also { list-style: none; padding-left: 0; }
.page-grid .page-content ul.also li { margin-bottom: 6px; padding-left: 14px; position: relative; }
.page-grid .page-content ul.also li::before { content: "→"; position: absolute; left: 0; color: var(--ink-blue); }
.page-grid .page-content ul.also b, .page-grid .page-content p.gp span[data-goto] { color: var(--ink-blue); cursor: pointer; }
.page-grid .page-content p.gp { background: #fff8d9; border-left: 3px solid #d8b84a; padding: 6px 8px; }
.tbl td.num { font-weight: 700; white-space: nowrap; }
.tbl td.note { color: var(--pencil); }

/* медаль победителя в журнале */
.journal tr.win td { background: rgba(216,184,74,.14); }
.journal .medal { margin-right: 4px; }

/* ---------- ляссе: тканевые закладки сверху книги ---------- */
.ribbons { position: absolute; top: -26px; left: 0; right: 0; height: 26px; z-index: 6; display: flex; gap: 12px; justify-content: flex-end; padding-right: 46px; }
.book.single .ribbons { display: none; }
.ribbon {
  position: relative; width: 86px; padding: 4px 0 10px; border: 0; cursor: pointer;
  font: 700 12px/1 var(--font-ui); color: #fff8ec; letter-spacing: .02em; text-align: center;
  border-radius: 3px 3px 0 0; box-shadow: 0 -2px 6px rgba(0,0,0,.25) inset, 0 2px 4px rgba(0,0,0,.2);
  transform: translateY(6px); transition: transform .18s ease;
}
.ribbon::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px; background: inherit;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 58%, 0 100%);
}
.ribbon:hover, .ribbon:focus-visible { transform: translateY(0); }
.ribbon.r1 { background: linear-gradient(180deg, #c8442f, #9d2f20); }
.ribbon.r2 { background: linear-gradient(180deg, #2f6fc4, #1f4d8d); }
.ribbon.r3 { background: linear-gradient(180deg, #b98a20, #8a6414); }

/* ---------- буквица и рукописные мелочи на странице ученика ---------- */
.page-content p.dropcap::first-letter {
  float: left; font: 700 52px/56px var(--font-mark); color: var(--ink-blue);
  margin: 0 8px 0 0; padding-top: 2px;
}
.essay-title, .essay-head .t1 { transform: rotate(var(--tilt, -.4deg)); }

/* подпись учителя росчерком */
.teacher-sign { margin: 2px 0 0 88px; display: flex; align-items: center; gap: 10px; color: var(--ink-red); font: italic 12px/1 var(--font-ui); opacity: .8; }
.teacher-sign svg { width: 96px; height: 26px; flex: none; }
.teacher-sign path { fill: none; stroke: var(--ink-red); stroke-width: 1.6; stroke-linecap: round; }

/* ---------- журнал: зебра и бейджи оценок ---------- */
.journal tbody tr:nth-child(even) td { background: rgba(29,63,158,.035); }
.journal tbody tr:hover td { background: rgba(29,63,158,.09); }
.journal .g { font: 700 13px/17px var(--font-ui); color: #fff; }
.journal .g span { display: inline-block; min-width: 28px; padding: 0 5px; border-radius: 9px; background: var(--g-c, #8a96a5); }
.journal tr.win td { background: rgba(216,184,74,.2) !important; }

/* ---------- педсовет: аккуратная диаграмма ---------- */
.bars .row { gap: 10px; }
.bars .bar { height: 16px; border-radius: 8px; background: linear-gradient(90deg, #7fb0e8, #2f6fc4); box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.bars .row.top .bar { background: linear-gradient(90deg, #e8c46a, #b98a20); }
.bars .n { font-weight: 700; color: #4a5566; }

/* на широких экранах эти разделы открываются с ляссе, дубли в шапке не нужны */
@media (min-width: 900px) { .jumps .only-narrow { display: none; } }
