@font-face {
  font-family: Inter;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-display: swap;
  font-weight: 100 900;
  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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: Inter;
  src: url('/fonts/inter-cyrillic-wght-normal.woff2') format('woff2');
  font-display: swap;
  font-weight: 100 900;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

:root {
  --bg:#edf4ff;
  --paper:#fffdf8;
  --ink:#11274b;
  --soft:#3d5372;
  --muted:#536882;
  --edge:#cbdaf0;
  --mint:#e1f6ff;
  --teal:#075bba;
  --teald:#123d8f;
  --red:#962a42;
  --shadow:0 10px 26px #193e7810;
}
html,body {font:17px/1.6 Inter,system-ui,sans-serif;}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline:3px solid #1473e3;
  outline-offset:3px;
}
.app {grid-template-columns:260px minmax(0,1fr);}
.sidebar {
  padding:24px 16px;
  gap:20px;
  background:linear-gradient(165deg,#ffffff 18%,#edf6ff 100%);
}
.logo {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  margin:0;
  padding:8px;
  width:100%;
  border:0;
  border-radius:15px;
  background:transparent;
  text-align:left;
  color:var(--ink);
}
.logo:hover {background:#dfedff;}
.brand-icon {width:68px;height:68px;border-radius:16px;box-shadow:0 5px 15px #123d8f30;}
.logo .logotext {display:block;min-width:0;}
.logo .logotext strong {color:#153e8a;font-size:20px;line-height:1.12;white-space:normal;letter-spacing:-.045em;}
.logo .logotext .brand-tagline {display:block;font-size:12px;line-height:1.4;color:#395875;margin-top:4px;}
.sidebar nav {min-width:0;}
.sidebtn {
  min-height:51px;
  justify-content:flex-start;
  color:#233d61;
  padding:10px 12px;
  font-size:16px;
  font-weight:700;
}
.sidebtn .navtext {display:inline;}
.sidebtn.active,.sidebtn:hover {background:#dfecff;color:#103b83;}
.sidebtn.active {box-shadow:inset 3px 0 #1873de;}
.notice,.small,.rr-settings-help {font-size:15px;color:var(--soft);}
.topbar {
  height:auto;
  min-height:69px;
  background:#f8fbff;
  padding:10px clamp(15px,3vw,44px);
}
.bread {font-size:14px;color:var(--soft);}
.topbar-actions {display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
.status {font-size:14px;color:var(--soft);}
.topbar .dot.online {background:#087eaa;}
.qr-trigger {white-space:nowrap;}
.content {padding:clamp(23px,4vw,47px) clamp(14px,3vw,43px) 64px;}
.headline h1 {
  color:#102d60;
  font-size:clamp(34px,4.1vw,57px);
  line-height:1.06;
  letter-spacing:-.045em;
  overflow-wrap:anywhere;
}
.sub,.bookcard p,.strip {font-size:17px;color:var(--soft);}
.bookcard strong {font-size:22px;color:#102d60;}
.card,.bookcard {border-color:var(--edge);}
.btn {
  min-height:44px;
  border-color:#b9cdeb;
  color:#183a67;
  text-decoration:none;
  font-size:16px;
  white-space:normal;
}
.btn:hover {background:#edf5ff;}
.btn.primary {background:linear-gradient(112deg,#123d9c,#056b9c);border-color:#0d479e;color:#fff;}
.btn.primary:hover {background:#123d8f;}
.btn.sm,.tag,.langlabel,.pagecount,.rr-note summary,.rr-collapse summary,.rr-settings-help {font-size:15px;}
.btn.sm {min-height:40px;}
.tag.grey {background:#e8f0fc;color:#29496c;}
.langlabel,.pagecount,.rr-collapse summary,.rr-micro,.rr-reading-info {color:#3d5576;}
.rr-micro,.rr-reading-info {font-size:14px;}
.language, .field input, .field select, .textedit {font-size:16px;min-height:43px;}
.reader-top,.scan-toolbar,.scan-footer {row-gap:10px;flex-wrap:wrap;}
.scan-stage {background:#e9f0fb;}
.document-page {color:#172946;line-height:1.74;}
.reading-grid {grid-template-columns:minmax(0,1.5fr) minmax(295px,.85fr);}
.rr-page-box {padding:20px;min-height:260px;}
.rr-page-box h3,.tool-card h3 {font-size:22px;color:#153b74;}
.rr-page-empty {color:#3b5270;font-size:16px;line-height:1.65;padding:12px 0 8px;}
.rr-page-box .translation-pane {font-size:19px;line-height:1.7;color:#152e51;border-color:#cddcf0;}
.rr-word-popover {width:min(408px,calc(100vw - 20px));border:1px solid #94b8e6;background:#fff;color:#152e51;}
.rr-pop-head strong {font-size:26px;}
.rr-pop-result {font-size:clamp(24px,4vw,30px);color:#064991;}
.rr-pop-meta,.rr-pop-expl,.rr-pop-loading,.rr-pop-deck summary,.rr-pop-alert {font-size:15px;color:#3b5270;}
.rr-pop-actions {flex-wrap:wrap;}
.rr-pop-actions button {flex:1 0 auto;}
.rr-pop-close {min-width:38px;min-height:38px;}
.rr-qr-dialog {text-align:center;}
.rr-qr-dialog .modalheader {text-align:left;}
.rr-qr-dialog img {display:block;width:min(232px,100%);height:auto;margin:14px auto;border:1px solid var(--edge);border-radius:12px;}
.rr-qr-dialog .modalactions {justify-content:center;flex-wrap:wrap;}
.rr-qr-dialog p {overflow-wrap:anywhere;}
@media(max-width:1120px) {
  .app {grid-template-columns:225px minmax(0,1fr);}
  .brand-icon {width:58px;height:58px;}
  .logo .logotext .brand-tagline {display:none;}
}
@media(max-width:950px) {
  .reading-grid {grid-template-columns:minmax(0,1fr);}
  .rightstack {position:static;grid-template-columns:minmax(0,1fr);max-height:none;overflow:visible;}
}
@media(max-width:760px) {
  .app {display:block;}
  .sidebar {position:relative;height:auto;overflow:visible;display:block;padding:12px;border:0;border-bottom:1px solid var(--edge);}
  .logo {width:fit-content;padding:4px 7px;}
  .brand-icon {width:48px;height:48px;border-radius:11px;}
  .logo .logotext strong {font-size:20px;}
  .sidebar nav {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-top:9px;align-items:stretch;}
  .sidebar nav .overline,.sidebottom {display:none;}
  .sidebar .sidebtn {font-size:14px;min-height:42px;padding:7px 6px;width:100%;gap:5px;white-space:normal;}
  .sidebtn span:first-child {font-size:16px;}
  .topbar {min-height:56px;}
  .status {display:none;}
  .content {padding-top:22px;}
}
@media(max-width:420px) {
  .sidebar nav {grid-template-columns:repeat(2,minmax(0,1fr));}
  .brand-icon {width:44px;height:44px;}
  .headline h1 {font-size:34px;}
  .rr-pop-actions .btn.sm {font-size:14px;}
  .rr-page-box {padding:16px;}
}

.site-header {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:clamp(12px,2vw,30px);
  padding:10px clamp(13px,2.3vw,32px);
  background:#f8fbff;
  border-bottom:1px solid var(--edge);
}
.site-header .logo {width:auto;padding:3px;gap:9px;}
.site-header .brand-icon {width:44px;height:44px;border-radius:11px;}
.site-header .logotext strong {font-size:17px;max-width:110px;}
.site-header nav {display:flex;align-items:center;gap:5px;flex-wrap:wrap;}
.nav-link {
  color:#233d61;
  font-size:15px;
  font-weight:700;
  border:0;
  border-radius:10px;
  background:transparent;
  padding:7px 12px;
  min-height:40px;
  text-align:center;
}
.nav-link.active,.nav-link:hover {color:#103b83;background:#dfecff;}
.nav-link.active {box-shadow:inset 0 -2px #1873de;}
.reader-content {max-width:1920px;padding:17px clamp(14px,2.1vw,32px) 42px;}
.reader-content .headline {align-items:center;margin-bottom:9px;}
.reader-content .headline h1 {font-size:clamp(28px,3vw,44px);margin:0 0 4px;}
.reader-content .headline .sub {font-size:14px;}
.reader-top {margin:12px 0 14px;column-gap:12px;}
.reader-content .reading-grid {
  --reading-height:max(330px,calc(100dvh - 255px));
  position:relative;
  display:block;
}
.reader-actions {margin-left:auto;justify-content:flex-end;}
.page-jump {max-width:100%;padding-inline:8px;}
.reader-translation {
  position:absolute;
  top:56px;
  right:10px;
  z-index:12;
  width:min(530px,calc(100% - 20px));
  max-height:calc(var(--reading-height) + 16px);
  max-height:min(calc(var(--reading-height) + 16px),78dvh);
  overflow:auto;
  overscroll-behavior:contain;
  border:1px solid #95b5e4;
  border-radius:15px;
  background:#fff;
  box-shadow:0 12px 36px #152f5d38;
}
.reader-translation[hidden] {display:none;}
.reader-translation .rr-page-box {border:none;box-shadow:none;}
.reader-extras {display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px;margin-top:12px;}
.reader-extras > details {border:1px solid var(--edge);border-radius:12px;padding:9px 12px;margin:0;background:#fff;}
.reader-extras > .rr-note {flex:1;min-width:min(100%,220px);}
.reader-focused,.reader-focused body {height:100%;overflow:hidden;}
.reader-focused .site-header,
.reader-focused .reader-content .headline,
.reader-focused .reader-content .reader-top,
.reader-focused .reader-extras {display:none;}
.reader-focused .reader-content {width:100%;height:100dvh;max-width:none;padding:0;}
.reader-focused .reading-grid {--reading-height:calc(100dvh - 76px);height:100%;}
.reader-focused .scan-card {height:100%;display:flex;flex-direction:column;border:0;border-radius:0;}
.reader-focused .scan-toolbar,.reader-focused .scan-selection {flex-shrink:0;}
.reader-focused .reader-content .scan-stage {flex:1 1 auto;height:auto;min-height:0;}
.scan-toolbar,.rr-page-head {
  min-height:62px;
  margin:0;
  padding:9px 14px;
  background:#f8fbff;
  border-bottom:1px solid var(--edge);
}
.scan-toolbar h2,.rr-page-head h2 {font-size:clamp(18px,2vw,23px);line-height:1.2;margin:0;color:#153b74;}
.scan-toolbar .page-menu {flex-wrap:wrap;}
.reader-content .scan-stage,.reader-content .scan-stage:has(.pdf-viewer),.rr-page-box .translation-pane {
  height:var(--reading-height);
  min-height:0;
  max-height:none;
  overflow:auto;
  padding:clamp(14px,2vw,28px);
  overscroll-behavior:contain;
}
.reader-content .scan-stage {padding:0;background:var(--paper);}
.reader-content .document-page {max-width:none;border:0;border-radius:0;padding:clamp(14px,2vw,28px);}
.rr-page-box {padding:0 0 13px;overflow:hidden;}
.rr-page-box .translation-pane {
  border:0;
  border-radius:0;
  overflow-wrap:anywhere;
  font-size:21px;
  line-height:1.74;
}
.rr-page-box > .rr-page-empty {padding:15px;margin:0;}
.rr-page-box:has(> .btn) > .rr-page-empty {min-height:0;}
.rr-page-box > :is(.btn,.rr-collapse,.rr-word-actions,.rr-micro,.rr-status-warn) {margin-inline:14px;}
.scan-selection:not(:has(.field)) {display:none;}
.scan-selection {padding:10px 14px;border-top:1px solid var(--edge);}
.rr-note textarea {font-size:16px;}
@media(max-width:900px) {
  .site-header nav {gap:2px;}
  .nav-link {padding:6px 9px;font-size:14px;}
}
@media(max-width:760px) {
  .site-header {grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;}
  .site-header .logotext strong {max-width:none;}
  .site-header nav {grid-row:2;grid-column:1/-1;}
  .site-header > .qr-trigger {grid-column:2;grid-row:1;}
  .reader-content .reading-grid {--reading-height:clamp(320px,65dvh,760px);}
  .reader-focused .reader-content .reading-grid {--reading-height:calc(100dvh - 120px);}
  .reader-actions {justify-content:flex-start;margin-left:0;}
  .reader-translation {top:100%;top:clamp(90px,18dvh,138px);}
  .scan-toolbar {padding-inline:8px;}
  .scan-toolbar .btn.sm {padding-inline:7px;}

}

.reader-translation .translation-pane {height:auto;max-height:calc(70dvh - 130px);min-height:70px;}
