@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 400; src: url(/assets/fonts/golos-text-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 400; src: url(/assets/fonts/golos-text-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 500; src: url(/assets/fonts/golos-text-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 500; src: url(/assets/fonts/golos-text-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 600; src: url(/assets/fonts/golos-text-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 600; src: url(/assets/fonts/golos-text-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 700; src: url(/assets/fonts/golos-text-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 700; src: url(/assets/fonts/golos-text-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'PT Serif'; font-style: normal; font-display: swap; font-weight: 400; src: url(/assets/fonts/pt-serif-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'PT Serif'; font-style: normal; font-display: swap; font-weight: 400; src: url(/assets/fonts/pt-serif-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'PT Serif'; font-style: normal; font-display: swap; font-weight: 700; src: url(/assets/fonts/pt-serif-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'PT Serif'; font-style: normal; font-display: swap; font-weight: 700; src: url(/assets/fonts/pt-serif-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-display: swap; font-weight: 600; src: url(/assets/fonts/unbounded-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-display: swap; font-weight: 600; src: url(/assets/fonts/unbounded-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
/* Підрунько: спільні стилі сторінок (головна, книга, вправа). Переглядач має власні стилі. */
:root{
  --bg:#f3f4f7; --surface:#ffffff; --fg:#1b1f27; --muted:#5d6676; --line:#d9dde4;
  --marker:#ffd60a; --marker-ink:#1b1f27; --accent:#1f5fd6; --accent-soft:rgba(31,95,214,.12);
  --ui:"Golos Text",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --brand:"Unbounded","Golos Text",system-ui,sans-serif;
  --serif:"PT Serif",Georgia,"Times New Roman",serif;
}
@media (prefers-color-scheme:dark){:root{--bg:#14171c;--surface:#1d2128;--fg:#e8ebf0;--muted:#9aa3b2;--line:#2e343e;--accent:#7aa7ff;--accent-soft:rgba(122,167,255,.16);color-scheme:dark}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--fg);font:16px/1.55 var(--ui)}
a{color:var(--accent)}
img{max-width:100%;height:auto}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.wrap{max-width:1080px;margin:0 auto;padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
.narrow{max-width:760px}

/* шапка */
.hdr{background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.hdr-in{display:flex;align-items:center;gap:18px;padding-block:10px}
.logo{font-family:var(--brand);font-weight:600;font-size:18px;color:var(--fg);text-decoration:none;white-space:nowrap}
.logo b{background:var(--marker);color:var(--marker-ink);padding:1px 6px;border-radius:4px;font-weight:600;margin-right:1px}
.logo.sm{font-size:15px}
.hnav{display:flex;gap:16px;flex:1;min-width:0}
.hnav a{color:var(--muted);text-decoration:none;font-size:14.5px;white-space:nowrap}
.hnav a:hover{color:var(--fg)}
.hfind{display:flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;flex:none}
.hfind input{width:96px;border:0;background:var(--bg);color:var(--fg);padding:7px 10px;font:inherit;font-size:14px;outline:none}
.hfind button{border:0;background:var(--marker);color:var(--marker-ink);font:600 14px var(--ui);padding:0 12px;cursor:pointer}
@media (max-width:720px){.hnav{display:none}.hdr-in{justify-content:space-between}.hfind input{width:78px}}

/* підвал */
.ftr{border-top:1px solid var(--line);background:var(--surface);margin-top:48px;font-size:14px;color:var(--muted)}
.ftr-in{display:grid;grid-template-columns:1fr auto;gap:12px 32px;padding-block:24px 32px}
.ftr nav{display:flex;gap:16px;flex-wrap:wrap}
.ftr nav a{color:var(--muted)}
.ftr p{margin:6px 0 0}.ftr .copy{grid-column:1/-1;font-size:12.5px}
@media (max-width:640px){.ftr-in{grid-template-columns:1fr}}

.main{padding-block:16px 8px}
.crumbs ol{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-wrap:wrap;gap:4px 8px;font-size:13.5px;color:var(--muted)}
.crumbs li+li::before{content:"›";margin-right:8px}
.crumbs a{color:var(--muted)}
.card{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:20px clamp(16px,3vw,28px)}
.btn{display:inline-block;background:var(--marker);color:var(--marker-ink);font-weight:700;text-decoration:none;border:0;border-radius:10px;padding:12px 18px;font-size:16px;cursor:pointer}
.note{color:var(--muted);font-size:14px}
h1,h2{text-wrap:balance;line-height:1.25}

/* головна */
.hero{background:var(--surface);border-bottom:1px solid var(--line);padding-block:48px 40px}
.hero h1{font-family:var(--brand);font-weight:600;font-size:clamp(28px,5vw,46px);margin:0 0 14px;max-width:16ch}
.hero mark{background:linear-gradient(transparent 55%,var(--marker) 55%);color:inherit;padding:0 2px}
.hero .lead{font-size:18px;max-width:58ch;color:var(--muted);margin:0 0 22px}
.steps{list-style:none;counter-reset:s;padding:0;margin:28px 0;display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.steps li{counter-increment:s;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:16px}
.steps li::before{content:counter(s);display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--marker);color:var(--marker-ink);font-weight:700;margin-bottom:8px}
.steps b{display:block}.steps span{color:var(--muted);font-size:14.5px}
@media (max-width:720px){.steps{grid-template-columns:1fr}}
.books h2{font-size:22px}
.bgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}
.bcard{display:flex;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px;text-decoration:none;color:var(--fg)}
.bcard:hover{border-color:var(--accent)}
.bcard img{width:84px;height:auto;border-radius:4px;box-shadow:0 1px 4px rgba(0,0,0,.15)}
.bcard span{display:flex;flex-direction:column;gap:2px;font-size:14px;color:var(--muted)}
.bcard b{color:var(--fg);font-size:17px}.bcard em{font-style:normal;color:var(--accent);margin-top:auto}

/* сторінка книги */
.bookhead{display:grid;grid-template-columns:200px 1fr;gap:24px;align-items:start;margin-bottom:24px}
.bookhead .cover{width:200px;border-radius:6px;box-shadow:0 2px 10px rgba(0,0,0,.18)}
.bookhead h1{margin:0 0 8px;font-size:clamp(24px,4vw,34px)}
.bookhead .lead{color:var(--muted);margin:0 0 10px}
.cta{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:14px 0}
.jump{display:flex;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.jump input{width:70px;border:0;padding:10px;font:inherit;background:var(--surface);color:var(--fg)}
.jump button{border:0;background:var(--bg);color:var(--fg);font:600 14px var(--ui);padding:0 12px;cursor:pointer}
@media (max-width:640px){.bookhead{grid-template-columns:1fr}.bookhead .cover{width:140px}}
.sec{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:16px 20px;margin-bottom:14px}
.sec h2{font-size:19px;margin:0 0 4px}
.sec .meta{margin:0 0 10px;color:var(--muted);font-size:14px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(56px,1fr));gap:6px}
.grid a{display:grid;place-items:center;height:40px;border:1px solid var(--line);border-radius:8px;text-decoration:none;color:var(--fg);font-variant-numeric:tabular-nums;font-weight:600}
.grid a:hover{border-color:var(--accent);background:var(--accent-soft)}
.grid a[aria-current]{background:var(--marker);border-color:var(--marker);color:var(--marker-ink)}

/* сторінка вправи */
.ex h1{margin:0 0 16px;font-size:clamp(22px,3.5vw,30px)}
.ex h1 mark{background:var(--marker);color:var(--marker-ink);padding:0 8px;border-radius:5px;margin-right:6px}
.h1s{display:block;font-size:15px;font-weight:500;color:var(--muted);margin-top:6px}
.ex h2{font-size:15px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:0 0 8px}
.cond{margin-bottom:22px}
.cond p{margin:0 0 10px;font-weight:600}
.cond img{display:block;width:100%;max-width:720px;border:1px solid var(--line);border-radius:8px;background:#fff}
.solhead{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.solhead h2{margin:0}
.tabs{display:inline-flex;border:1px solid var(--line);border-radius:9px;overflow:hidden}
.tabs button{border:0;background:var(--surface);color:var(--muted);font:500 14px var(--ui);padding:7px 12px;cursor:pointer}
.tabs button[aria-selected="true"]{background:var(--accent-soft);color:var(--fg);font-weight:700}
.open-book{display:inline-block;margin-top:18px;font-weight:600}
.pnav{display:flex;justify-content:space-between;gap:12px;margin:14px 0}
.pnav a{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:10px 14px;text-decoration:none;font-weight:600}
.others{margin-top:18px}.others h2{font-size:17px;margin:0}.others .sec-t{color:var(--muted);margin:2px 0 10px;font-size:14px}

/* розв'язок: з docx, формули SVG + прихований MathML */
.sol{background:#fff;color:#1b1f27;border:1px solid var(--line);border-radius:10px;padding:14px clamp(12px,2.5vw,20px);font-family:var(--serif);font-size:18px;line-height:1.5;overflow:hidden}
.sol>p:first-of-type{display:none}
.sol p{margin:0 0 .3em;overflow-x:auto;overflow-y:hidden}
.sol mark.hl-yellow{background:#ffe600;color:inherit;padding:0 3px}
.sol mark.hl-lightGray{background:#ebebeb;color:inherit;padding:0 3px}
.sol .es{white-space:nowrap;margin-right:.25em}.sol .es:last-child{margin-right:0}
.sol .lead{margin-right:.25em}.sol .pn{font-style:normal}
.sol img{display:block;max-width:100%;height:auto;margin:6px 0}
.sol .tw{overflow-x:auto}
.sol table{border-collapse:collapse;margin:6px 0}.sol td{border:1px solid #333;padding:2px 10px;text-align:center}.sol td p{margin:0}
mjx-container{display:inline-block;vertical-align:middle;margin:2px 0;position:relative}
mjx-container svg{overflow:visible}
mjx-assistive-mml{position:absolute!important;top:0;left:0;clip:rect(1px,1px,1px,1px);padding:1px 0 0 0!important;border:0!important;display:block!important;width:auto!important;overflow:hidden!important;user-select:none}
.sol .xr,.sol .xm{border-radius:8px;padding:10px 12px;margin:4px 0 12px;font-family:var(--ui);font-size:15px;line-height:1.5}
.sol .xr{background:#eef4ff;border-left:4px solid #1f5fd6}
.sol .xm{background:#fff1ee;border-left:4px solid #d9472b;margin-top:14px}
.sol .xr p,.sol .xm p{margin:0;overflow:visible;display:block!important}
.sol .xt{font-weight:700;font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:#1f5fd6;margin-bottom:4px;display:flex;justify-content:space-between;gap:8px}
.sol .xm .xt{color:#b3361d}.sol .ref{font-weight:500;text-transform:none;letter-spacing:0;color:#5d6676}
.sol .xn{font-family:var(--ui);font-size:14.5px;line-height:1.45;color:#3c4656;background:#f5f6f8;border-radius:6px;padding:6px 10px;margin:12px 0 4px;overflow:visible}

/* «Знайшли помилку?» */
.repLink{display:flex;justify-content:center;margin-top:12px}
.repLink button{border:0;background:none;color:var(--muted);font:500 14px var(--ui);cursor:pointer;padding:6px 10px;border-radius:6px}
.repLink button:hover{color:#b3361d;background:var(--accent-soft)}
.rep{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(560px,100%);z-index:50;background:var(--surface);border:1px solid var(--line);border-bottom:0;border-radius:14px 14px 0 0;box-shadow:0 -12px 40px rgba(0,0,0,.2);padding:16px 18px calc(16px + env(safe-area-inset-bottom));max-height:90vh;overflow:auto}
.rep h3{margin:0 0 2px}.rep .sub{margin:0 0 12px;color:var(--muted);font-size:13px}
.rep fieldset{border:0;padding:0;margin:0 0 12px}
.rep legend,.rep .lbl{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:6px;padding:0;display:block}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chips label{position:relative}
.chips input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.chips span{display:inline-block;border:1px solid var(--line);border-radius:999px;padding:5px 11px;font-size:13.5px;cursor:pointer}
.chips input:checked+span{background:var(--accent);border-color:var(--accent);color:#fff}
.chips input:focus-visible+span{outline:3px solid var(--accent);outline-offset:2px}
.rep textarea,.rights input,.rights textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:15px var(--ui);background:var(--bg);color:var(--fg)}
.rep textarea{min-height:64px}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.rep .row{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}
.rep .row button,.rep .done button{border:1px solid var(--line);background:var(--surface);color:var(--fg);border-radius:8px;height:38px;padding:0 14px;font:600 14px var(--ui);cursor:pointer}
.rep .row .send{background:var(--marker);color:var(--marker-ink);border-color:var(--marker)}
.err{color:#b3361d;font-size:13px}
.rep .done{text-align:center;padding:10px}.rep .done b{display:block;font-size:17px}
.prose p{max-width:68ch}
.rights{display:grid;gap:6px;max-width:520px;margin-top:16px}
.rights label{font-size:14px;font-weight:600;margin-top:6px}
.rights textarea{min-height:110px}
.rights .btn{justify-self:start;margin-top:8px}

/* Зручні для пальця цілі на телефоні */
@media (max-width:720px){
  .crumbs ol{font-size:14px;gap:0 6px}
  .crumbs a{display:inline-flex;align-items:center;min-height:40px}
  .crumbs li{display:inline-flex;align-items:center;min-height:40px}
  .tabs{display:flex}
  .tabs button{flex:1;min-height:44px;font-size:15px}
  .ftr nav a{display:inline-flex;align-items:center;min-height:44px;padding:0 4px}
  .repLink button,#repOpen{min-height:44px}
  .open-book{display:inline-flex;align-items:center;min-height:44px}
}
/* Перевірте себе */
.xh{font-family:var(--brand);font-size:20px;margin:28px 0 12px}
.xitem{margin:0 0 14px;scroll-margin-top:16px}
.xitem h3{font-size:16px;margin:0 0 10px;line-height:1.4}
.xitem h3 mark{background:var(--marker);color:var(--marker-ink);padding:0 6px;border-radius:4px;margin-right:6px}
.xitem:target{outline:3px solid var(--marker);outline-offset:2px}
.sec.chk{background:var(--accent-soft);border-radius:12px;padding:12px 14px}
.sec.chk h2 a{color:inherit}
