/* LibTas — лёгкая версия для электронных читалок (Kindle, PocketBook, Kobo, Onyx).
   Только чёрное и белое. Без CSS-переменных, oklch, color-mix, grid, gap,
   position: sticky/fixed, анимаций и JS: всё работает в старых WebKit читалок.
   Раскладка — блоки и display: table. Выбранное показываем инверсией и «✓», не цветом. */

.ek { background: #fff; color: #000; font-family: Georgia, "PT Serif", "Times New Roman", serif; font-size: 20px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
.ek * { box-sizing: border-box; }
.ek a { color: #000; text-decoration: underline; }
.ek img { filter: grayscale(1); }
/* Сброс отступов — только по тегам, чтобы классы ниже (.ek-count, .ek-label, .ek-h2…) могли задавать свои */
h1, h2, p, ul, ol, dl { margin: 0; }

.ek-wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.ek-section { margin-top: 32px; }
.ek-small { font-size: 17px; }
.ek-bold { font-weight: bold; }

/* Шапка */
.ek-header { border-bottom: 3px solid #000; padding-top: 14px; }
.ek-top { display: table; width: 100%; }
.ek-top-cell { display: table-cell; vertical-align: middle; }
.ek-top-right { text-align: right; font-size: 17px; }
.ek-brand { font-size: 28px; font-weight: bold; text-decoration: none !important; }
.ek-nav { list-style: none; padding: 0; margin: 6px 0 0 -12px; }
.ek-nav li { display: inline-block; }
.ek-nav a { display: inline-block; min-height: 48px; padding: 10px 12px 8px; text-decoration: none; border-bottom: 5px solid #fff; }
.ek-nav a.ek-current { font-weight: bold; border-bottom-color: #000; }

/* Заголовки */
.ek-h1 { font-size: 30px; line-height: 1.2; font-weight: bold; }
.ek-h2 { font-size: 24px; line-height: 1.25; font-weight: bold; padding-bottom: 6px; border-bottom: 2px solid #000; margin-bottom: 14px; }
.ek-eyebrow { font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase; }

/* Формы и кнопки: высота от 52px, толстая рамка, никаких скруглений и теней */
.ek-label { display: block; font-size: 17px; font-weight: bold; margin-bottom: 6px; }
.ek-input, .ek-select { display: block; width: 100%; height: 52px; padding: 0 12px; border: 2px solid #000; border-radius: 0; background: #fff; color: #000; font: inherit; -webkit-appearance: none; appearance: none; }
.ek-select { background: #fff; padding-right: 36px; }
.ek-btn { display: inline-block; min-height: 52px; padding: 12px 20px; border: 2px solid #000; border-radius: 0; background: #fff; color: #000; font: inherit; font-weight: bold; line-height: 24px; text-align: center; text-decoration: none !important; -webkit-appearance: none; appearance: none; }
.ek-btn-primary { background: #000; color: #fff !important; }
.ek-btn-block { display: block; width: 100%; }
.ek-row { display: table; width: 100%; }
.ek-row-grow { display: table-cell; vertical-align: bottom; width: 100%; }
.ek-row-fixed { display: table-cell; vertical-align: bottom; padding-left: 10px; white-space: nowrap; }
.ek-field { margin-top: 18px; }
.ek-check { display: block; min-height: 48px; padding-top: 10px; }
.ek-check input { width: 24px; height: 24px; margin: 0 10px 0 0; vertical-align: -4px; accent-color: #000; }

/* Список книг */
.ek-count { margin: 36px 0 10px; font-size: 17px; }
.ek-list { list-style: none; padding: 0; border-top: 2px solid #000; }
.ek-item { border-bottom: 1px solid #000; }
.ek-item-link { display: table; width: 100%; padding: 14px 0; text-decoration: none !important; }
.ek-thumb { display: table-cell; width: 84px; vertical-align: top; padding-right: 16px; }
.ek-thumb img, .ek-nocover { display: block; width: 68px; height: 102px; border: 1px solid #000; }
.ek-nocover { padding: 6px; font-size: 12px; line-height: 1.25; text-align: center; overflow: hidden; }
.ek-meta { display: table-cell; vertical-align: top; }
.ek-title { font-weight: bold; text-decoration: underline; }
.ek-score { display: inline-block; margin-top: 6px; padding: 0 8px; border: 2px solid #000; font-size: 16px; font-weight: bold; }

/* Постраничная навигация */
.ek-pager { display: table; width: 100%; margin-top: 24px; }
.ek-pager-cell { display: table-cell; width: 33%; vertical-align: middle; }
.ek-pager-mid { text-align: center; font-size: 17px; }
.ek-pager-right { text-align: right; }
.ek-disabled { border-style: dashed; font-weight: normal; }

/* Страница книги */
.ek-book { display: table; width: 100%; margin-top: 24px; }
.ek-book-cover { display: table-cell; width: 176px; vertical-align: top; padding-right: 20px; }
.ek-book-cover img { display: block; width: 156px; height: 234px; border: 1px solid #000; }
.ek-book-head { display: table-cell; vertical-align: top; }
.ek-dl { display: table; width: 100%; font-size: 17px; border-collapse: collapse; margin-bottom: 18px; }
.ek-dl-row { display: table-row; }
.ek-dl dt, .ek-dl dd { display: table-cell; vertical-align: top; padding: 9px 0; margin: 0; border-bottom: 1px solid #000; }
.ek-dl dt { width: 150px; padding-right: 12px; }
.ek-review { padding: 16px; border: 2px solid #000; margin-bottom: 16px; }
.ek-review-plain { padding: 16px 0; border-top: 1px solid #000; }
.ek-review p { margin-top: 10px; }
.ek-ol { padding-left: 32px; }
.ek-ol li { padding: 8px 0; }

/* Подвал */
.ek-footer { margin-top: 40px; padding: 16px 0 28px; border-top: 3px solid #000; font-size: 17px; }

/* Вход */
.ek-login { max-width: 460px; margin: 0 auto; padding: 48px 20px; }
.ek-login-card { margin-top: 24px; padding: 24px; border: 3px solid #000; }

/* Компактный список без обложек */
.ek-compact .ek-item-link { display: block; padding: 12px 0; }

/* Сегменты: «Моя полка», «Вид». Ячейки таблицы во всю ширину, общая рамка,
   выбранное — инверсия, жирный и «✓». Кнопка/ссылка внутри ячейки — блок на всю ширину. */
.ek-seg { display: table; width: 100%; table-layout: fixed; border-collapse: collapse; }
.ek-seg-cell { display: table-cell; vertical-align: top; }
.ek-seg-btn { display: block; width: 100%; min-height: 52px; padding: 13px 8px; border: 2px solid #000; border-radius: 0; background: #fff; color: #000; font: inherit; font-size: 17px; line-height: 22px; text-align: center; text-decoration: none !important; -webkit-appearance: none; appearance: none; }
.ek-seg-cell + .ek-seg-cell .ek-seg-btn { border-left-width: 0; }
.ek-seg-btn.ek-on { background: #000; color: #fff !important; font-weight: bold; }

/* Читалка без JS (/lite/books/{id}/read): тонкая панель сверху, текст, пейджер снизу */
.ek-readbar { display: table; width: 100%; padding: 10px 0; border-bottom: 2px solid #000; font-size: 17px; }
.ek-readbar-cell { display: table-cell; vertical-align: middle; }
.ek-readbar-mid { padding: 0 10px; text-align: center; }
.ek-readbar-right { text-align: right; white-space: nowrap; }
.ek-readbar a { display: inline-block; min-height: 44px; padding: 10px 6px; }
.ek-read { padding: 20px 0 8px; line-height: 1.5; word-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.ek-read p { margin: 0; text-indent: 1.5em; text-align: justify; }
.ek-read h1, .ek-read h2, .ek-read h3, .ek-read h4, .ek-read h5, .ek-read h6 { margin: 1em 0 0.6em; line-height: 1.25; text-indent: 0; text-align: center; }
.ek-read h1 { font-size: 1.5em; }
.ek-read h2 { font-size: 1.3em; }
.ek-read h3, .ek-read h4, .ek-read h5, .ek-read h6 { font-size: 1.1em; }
.ek-read blockquote { margin: 0.8em 0 0.8em 1.5em; }
.ek-read ul, .ek-read ol { margin: 0.6em 0; padding-left: 1.5em; }
.ek-read li p, .ek-read blockquote p, .ek-read td p { text-indent: 0; }
.ek-read img { display: block; max-width: 100%; height: auto; margin: 0.8em auto; }
.ek-read table { border-collapse: collapse; margin: 0.8em 0; }
.ek-read td, .ek-read th { border: 1px solid #000; padding: 4px 8px; }
.ek-read pre { white-space: pre-wrap; font-size: 0.85em; }
.ek-read hr { border: 0; border-top: 1px solid #000; margin: 1em 20%; }
.ek-read sup, .ek-read sub { font-size: 0.7em; line-height: 0; }
.ek-read sup a, .ek-read sub a { display: inline-block; padding: 0 4px; }
.ek-read .ek-center { text-align: center; }
.ek-read-end { margin: 24px 0 8px; padding: 16px; border: 2px solid #000; text-align: center; }
.ek-toc { list-style: none; padding: 0; border-top: 2px solid #000; }
.ek-toc li { border-bottom: 1px solid #000; }
.ek-toc a, .ek-toc span { display: block; padding: 12px 0; min-height: 48px; }
.ek-toc .ek-on { font-weight: bold; }
.ek-read-alt { margin-top: 8px; font-size: 17px; text-align: center; }
.ek-toc a.ek-toc-link { display: table; width: 100%; padding: 0; min-height: 0; }
.ek-toc .ek-toc-label, .ek-toc .ek-toc-page { display: table-cell; vertical-align: middle; padding: 12px 0; }
.ek-toc .ek-toc-page { width: 1%; padding-left: 12px; white-space: nowrap; text-align: right; font-weight: normal; }
