:root {
  --bg: #f5f7f8; --surface: #fff; --text: #252d2b; --muted: #626e69;
  --line: #e2e7e8; --accent: #247565; --accent-soft: #e6f2ed; --rose: #a25d6b;
  --rose-soft: #faedf0; --ochre: #aa7934; --ochre-soft: #fbf1de;
  --error: #b44848; --shadow: 0 12px 40px #202c2614;
  color-scheme: light;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Arial, sans-serif;
  font-size: 16px; letter-spacing: 0;
}
* { box-sizing: border-box; }
body { margin: 0; padding-top: var(--tg-content-safe-area-inset-top, 0px); color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button, input, select, textarea { border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #88b5a1; outline-offset: 3px; }
button { background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.2; font-weight: 650; }
h2 { font-size: 21px; font-weight: 650; }
svg { flex-shrink: 0; width: 21px; height: 21px; stroke-width: 1.7; }
[hidden] { display: none !important; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 246px; background: var(--surface); border-right: 1px solid var(--line); padding: 37px 22px 30px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 4px 50px; font-size: 23px; font-weight: 650; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 46px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; }
.brand-mark svg { width: 26px; height: 26px; }
.brand-caption { display: block; font-size: 11px; font-weight: 400; margin-top: 5px; color: var(--muted); }
.side-nav { display: grid; gap: 9px; }
.side-nav button { display: flex; align-items: center; gap: 13px; min-height: 49px; border-radius: 6px; padding: 0 15px; font-size: 14px; text-align: left; }
.side-nav button svg { color: var(--muted); }
.side-nav button.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.side-nav button.active svg { color: var(--accent); }
#side-count { margin-left: auto; font-size: 12px; }
.side-bottom { margin-top: auto; display: flex; gap: 14px; border-top: 1px solid var(--line); padding: 25px 12px 2px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.side-bottom svg { color: var(--rose); width: 18px; }
.workspace { margin: 0; }
.topbar { height: 78px; padding: 0 max(28px, calc((100% - 996px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--surface); }
.desktop-greeting { font-size: 13px; color: var(--muted); }
.profile-button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0; font-size: 13px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #eee3e6; color: #89636c; font-weight: 650; }
.mobile-brand { display: flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 650; padding: 0; }
.mobile-brand .brand-mark { width: 36px; height: 38px; }
.mobile-brand svg { width: 23px; height: 23px; }
.bottom-nav { position: fixed; inset: auto 0 0; z-index: 5; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); padding: 7px max(12px, calc((100% - 650px) / 2)) max(10px, env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px)); }
.bottom-nav button { min-height: 66px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px; padding: 8px 0 0; font-size: 12px; line-height: 1.15; font-weight: 550; }
.bottom-nav button.active { color: var(--accent); }
.bottom-nav button.active > svg { stroke-width: 2.3; }
.bottom-nav svg { width: 24px; height: 24px; }
.bottom-nav button > span:last-child { min-height: 28px; display: grid; align-content: center; }
.bottom-nav .nav-add { padding-top: 0; }
.add-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin-top: -8px; border-radius: 50%; color: #fff; background: var(--accent); box-shadow: 0 3px 8px #24756524; }
.add-symbol svg { width: 26px; height: 26px; stroke-width: 2; }
.nav-add.active .add-symbol { outline: 4px solid var(--accent-soft); }
main { max-width: 1060px; margin: 0 auto; padding: 32px 32px 134px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.eyebrow { color: var(--muted); font-size: 10px; margin-bottom: 10px; }
.subtitle { margin-top: 11px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.button { min-height: 48px; border-radius: 6px; padding: 12px 17px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 15px; font-weight: 550; }
.button:hover { background: #2b5142; }
.button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.button.secondary:hover { border-color: #91aa9b; }
.button.soft { background: var(--accent-soft); color: var(--accent); }
.button.danger { background: var(--error); }
.icon-button { width: 43px; height: 43px; padding: 10px; display: inline-grid; place-items: center; border-radius: 6px; }
.icon-button:hover { background: var(--accent-soft); }
.currently-reading { border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 25px; }
.section-label { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; margin-bottom: 18px; }
.section-label svg { color: var(--accent); width: 18px; }
.reading-row { display: flex; gap: 27px; }
.reading-book { display: flex; gap: 19px; text-align: left; min-width: 0; width: 100%; max-width: 470px; padding: 0; }
.reading-cover { width: 85px; flex: 0 0 85px; aspect-ratio: 2/3; border-radius: 3px; box-shadow: 2px 4px 10px #00000015; }
.reading-info { align-self: center; min-width: 0; }
.reading-info h3 { font-family: Georgia, serif; font-weight: 500; font-size: 21px; line-height: 1.3; margin: 7px 0 8px; overflow-wrap: anywhere; }
.reading-info p { font-size: 13px; color: var(--muted); }
.reading-info .text-link { margin-top: 15px; font-size: 12px; }
.text-link { color: var(--accent); display: inline-flex; align-items: center; gap: 6px; font-weight: 550; }
.text-link svg { width: 16px; height: 16px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; font-size: 10px; line-height: 1.5; padding: 4px 7px; font-weight: 500; }
.pill.reading { color: var(--ochre); background: var(--ochre-soft); }
.pill.wanted { color: var(--rose); background: var(--rose-soft); }
.pill.finished, .pill.device { color: var(--accent); background: var(--accent-soft); }
.pill.sent, .pill.abandoned { color: var(--muted); background: var(--line); }
.library-controls { margin-bottom: 26px; }
.shelf-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 21px; }
.shelf-tabs button { padding: 0 0 14px; min-height: 45px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.shelf-tabs button.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.tab-count { font-size: 11px; padding: 3px 6px; border-radius: 4px; margin-left: 6px; background: var(--line); }
.control-row { display: flex; align-items: center; gap: 12px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0 13px; }
.search-field svg { width: 18px; color: var(--muted); }
.search-field input { width: 100%; min-width: 0; padding: 12px 0; background: transparent; color: var(--text); outline-offset: -1px; font-size: 14px; }
input::placeholder { color: var(--muted); opacity: .9; }
select { border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface); min-height: 46px; padding: 9px 27px 9px 12px; max-width: 100%; font-size: 13px; }
.view-switch { display: flex; border: 1px solid var(--line); border-radius: 6px; padding: 3px; background: var(--surface); }
.view-switch button { width: 35px; height: 36px; padding: 8px; border-radius: 3px; color: var(--muted); }
.view-switch button.active { background: var(--accent-soft); color: var(--accent); }
.view-switch svg { width: 18px; height: 18px; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 13px; color: var(--muted); }
.results-header strong { color: var(--text); font-weight: 500; }
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 29px; row-gap: 31px; }
.book-card { min-width: 0; position: relative; }
.book-open { width: 100%; display: block; text-align: left; padding: 0; }
.cover-wrap { position: relative; width: 100%; aspect-ratio: 2/3; background: #e9ece7; border-radius: 4px; overflow: hidden; box-shadow: 2px 5px 12px #1e28201a; }
.cover { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; padding: 20px; background: #e4ebe5; color: #65816f; text-align: center; }
.cover-placeholder span { font-family: Georgia, serif; font-size: 19px; line-height: 1.5; overflow-wrap: anywhere; }
.cover-placeholder span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cover-placeholder svg { width: 30px; height: 30px; }
.reading-cover .cover-placeholder { padding: 8px; gap: 6px; }
.reading-cover .cover-placeholder span { display: none; }
.reading-cover .cover-placeholder svg { width: 19px; height: 19px; }
.book-card:nth-child(3n+2) .cover-placeholder { background: #eee6eb; color: #997485; }
.book-card:nth-child(3n) .cover-placeholder { background: #e5e9ef; color: #758292; }
.book-info { padding-top: 12px; }
.book-info h3 { font-size: 15px; line-height: 1.4; font-weight: 600; margin: 0 0 5px; overflow-wrap: anywhere; }
.book-info .author { font-size: 12px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.book-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.rating-mini { font-size: 12px; display: flex; align-items: center; gap: 3px; color: var(--ochre); }
.rating-mini svg { width: 12px; height: 12px; fill: var(--ochre); }
.card-save { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: #ffffffeb; display: grid; place-items: center; color: var(--accent); box-shadow: 0 2px 8px #0001; }
.card-save svg { width: 17px; height: 17px; }
.book-grid.list-view { display: grid; grid-template-columns: 1fr; gap: 0; }
.list-view .book-card { padding: 17px 0; border-bottom: 1px solid var(--line); }
.list-view .book-open { display: flex; gap: 20px; }
.list-view .cover-wrap { width: 65px; flex: 0 0 65px; }
.list-view .book-info { padding: 0; align-self: center; }
.list-view .card-save { top: 22px; }
.load-more { margin: 28px auto 0; display: flex; }
.search-modes { display: inline-flex; border: 1px solid var(--line); padding: 4px; border-radius: 6px; background: var(--surface); margin-bottom: 20px; }
.search-modes button { padding: 10px 18px; border-radius: 3px; min-height: 40px; color: var(--muted); font-size: 14px; }
.search-modes button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.catalog-search { display: flex; gap: 12px; margin-bottom: 22px; }
.catalog-search .search-field { min-height: 50px; }
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 21px 0 30px; }
.quick-actions .button { font-size: 13px; }
.empty-state, .loading-state, .error-state { padding: 46px 15px; text-align: center; }
.empty-state > svg, .error-state > svg { width: 43px; height: 43px; color: #9caea0; margin-bottom: 18px; }
.empty-state h2, .error-state h2 { font-size: 22px; margin-bottom: 12px; }
.empty-state p, .error-state p, .loading-state p { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 380px; margin: 0 auto 24px; }
.loading-state p { margin-top: 20px; }
.spinner { width: 22px; height: 22px; display: inline-block; border: 2px solid #bed1c5; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.settings-section { max-width: 600px; margin: 25px 0; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.settings-section h2 { font-size: 18px; margin-bottom: 22px; }
.field-label { display: block; color: var(--muted); font-size: 14px; margin: 20px 0 9px; }
.text-input, textarea { width: 100%; min-height: 48px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
textarea { resize: vertical; min-height: 110px; font-size: 15px; line-height: 1.6; }
.settings-section .button { margin-top: 20px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 600px; padding: 23px 0; border-block: 1px solid var(--line); }
.profile-stats strong { font-size: 27px; font-weight: 600; display: block; margin-bottom: 7px; }
.profile-stats span { font-size: 13px; color: var(--muted); }
dialog { border: 0; background: var(--surface); color: var(--text); padding: 0; }
.modal-open { overflow: hidden; }
dialog::backdrop { background: #15251ecc; backdrop-filter: blur(3px); }
.book-dialog { width: min(650px, calc(100% - 36px)); border-radius: 8px; max-height: calc(100dvh - 60px); }
.detail-top { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; justify-content: space-between; align-items: center; padding: 16px 23px 8px; color: var(--muted); font-size: 12px; }
.detail-content { padding: 10px 29px 28px; }
.detail-heading { display: flex; gap: 24px; align-items: center; margin-bottom: 23px; }
.detail-cover { width: 122px; flex: 0 0 122px; aspect-ratio: 2/3; border-radius: 3px; overflow: hidden; box-shadow: 2px 5px 15px #0002; }
.detail-heading h2 { font-family: Georgia, serif; font-size: 26px; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; }
.detail-heading p { font-size: 14px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.detail-subtitle { font-size: 12px !important; }
.detail-description { font-size: 14px; color: var(--muted); line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; max-height: 210px; overflow-y: auto; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.detail-author { width: 100%; display: flex; justify-content: center; padding: 11px; border-top: 1px solid var(--line); }
.detail-section { border-top: 1px solid var(--line); padding-top: 19px; margin-top: 18px; }
.detail-section h3 { font-size: 14px; margin-bottom: 12px; }
.detail-section select { width: 100%; color: var(--text); }
.detail-progress { margin-top: 12px; }
.holding-options { display: flex; flex-wrap: wrap; gap: 18px; }
.holding-options label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; min-height: 40px; }
input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--accent); }
.stars { display: flex; gap: 8px; }
.stars button { min-width: 40px; min-height: 42px; color: #c2c7be; padding: 7px; }
.stars svg { width: 27px; height: 27px; }
.stars .selected { color: var(--ochre); }
.stars .selected svg { fill: var(--ochre); }
.review-footer { margin-top: 11px; display: flex; justify-content: space-between; align-items: center; }
.review-footer span { font-size: 12px; color: var(--muted); }
.remove-book { color: var(--error); font-size: 13px; min-height: 44px; margin-top: 15px; }
.format-picker { border: 1px solid var(--line); background: var(--bg); padding: 14px; border-radius: 6px; margin-bottom: 20px; }
.format-picker select { width: 100%; margin: 12px 0; }
.format-picker .button { width: 100%; }
.confirm-dialog { width: min(420px, calc(100% - 36px)); padding: 25px; border-radius: 8px; }
.confirm-dialog h2 { font-size: 20px; }
.confirm-dialog p { margin: 16px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.dialog-actions { display: flex; gap: 12px; }
.dialog-actions .button { flex: 1; }
.toast { position: fixed; bottom: 105px; left: 50%; transform: translateX(-50%); z-index: 10; width: max-content; max-width: min(460px, calc(100% - 40px)); background: var(--text); color: var(--surface); padding: 15px 20px; border-radius: 6px; font-size: 14px; line-height: 1.5; box-shadow: var(--shadow); text-align: center; }
.download-progress { position: fixed; bottom: 105px; right: 24px; width: min(420px, calc(100% - 40px)); max-height: 40dvh; overflow-y: auto; display: flex; align-items: center; gap: 15px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 8px; padding: 16px; z-index: 8; }
.download-progress > div { min-width: 0; flex: 1; }
.download-progress strong { font-size: 14px; }
.download-progress p { margin-top: 5px; line-height: 1.5; color: var(--muted); font-size: 12px; white-space: pre-line; overflow-wrap: anywhere; }
.download-progress .icon-button { flex: 0 0 36px; width: 36px; height: 36px; }
@media (min-width: 1450px) { .book-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1130px) { .book-grid { gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .sidebar, .desktop-greeting { display: none; }
  .workspace { margin-left: 0; }
  .topbar { height: 66px; padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top)); }
  .mobile-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 650; }
  .mobile-brand svg { color: var(--accent); width: 26px; height: 26px; }
  #profile-name { display: none; }
  main { padding: 24px 20px 130px; }
  h1 { font-size: 28px; }
  .page-heading { margin-bottom: 25px; align-items: flex-start; }
  .page-heading .button { min-height: 43px; padding: 10px 12px; }
  .page-heading .button .desktop-label { display: none; }
  .eyebrow { margin-bottom: 9px; font-size: 9px; }
  .subtitle { font-size: 13px; }
  .currently-reading { margin-bottom: 21px; padding-bottom: 21px; }
  .reading-cover { width: 72px; flex-basis: 72px; }
  .reading-book { gap: 17px; }
  .reading-info h3 { font-size: 20px; }
  .reading-info .text-link { margin-top: 10px; }
  .reading-row > .reading-book:nth-child(n+2) { display: none; }
  .shelf-tabs { gap: 22px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
  .shelf-tabs button { font-size: 13px; }
  .tab-count { display: none; }
  .control-row { flex-wrap: wrap; gap: 9px; }
  .control-row .search-field { flex: 1 0 calc(100% - 77px); }
  .control-row .view-switch { order: 0; }
  .control-row > select { order: 1; flex: 1; min-width: 0; min-height: 40px; font-size: 12px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 21px; }
  .book-info h3 { font-size: 16px; }
  .book-info .author { font-size: 13px; }
  .pill { font-size: 10px; }
  .results-header { margin-bottom: 18px; font-size: 12px; }
  .results-header .text-link { font-size: 12px; }
  .bottom-nav { padding-inline: 6px; }
  .bottom-nav button { font-size: 12px; }
  .search-modes { display: flex; width: 100%; }
  .search-modes button { flex: 1; padding: 10px 8px; font-size: 13px; }
  .catalog-search { gap: 8px; }
  .catalog-search .button { padding: 12px; }
  .catalog-search .search-field { min-width: 0; }
  .quick-actions { gap: 8px; margin-top: 18px; }
  .quick-actions .button { padding: 10px 12px; font-size: 12px; }
  .book-dialog { width: 100%; max-width: 100%; max-height: calc(100dvh - 28px); margin: auto 0 0; border-radius: 8px 8px 0 0; }
  .detail-content { padding: 8px 22px max(26px, env(safe-area-inset-bottom)); }
  .detail-top { padding-inline: 18px; }
  .detail-heading { gap: 18px; }
  .detail-cover { width: 105px; flex-basis: 105px; }
  .detail-heading h2 { font-size: 24px; }
  .detail-actions { gap: 9px; }
  .detail-actions .button { padding-inline: 10px; font-size: 13px; }
  .toast { bottom: 104px; }
  .download-progress { bottom: 104px; right: 16px; width: calc(100% - 32px); }
}
@media (max-width: 359px) { main { padding-inline: 16px; } .book-grid { column-gap: 17px; } .shelf-tabs { gap: 17px; } .detail-heading h2 { font-size: 21px; } .detail-cover { width: 90px; flex-basis: 90px; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
html[data-theme=dark] {
  --bg: #1c2220; --surface: #242c28; --text: #e6ebe7; --muted: #a2ada5;
  --line: #354039; --accent: #a1c7b3; --accent-soft: #30463a;
  --rose: #d6a1b0; --rose-soft: #403037; --ochre: #e5be77; --ochre-soft: #423b2a;
  color-scheme: dark;
}
html[data-theme=dark] .button:not(.secondary):not(.soft):not(.danger) { color: #173327; }
html[data-theme=dark] .card-save { background: #242c28ef; }

.reader-strip { width: 100%; display: flex; align-items: center; gap: 13px; padding: 16px 0; border-block: 1px solid var(--line); text-align: left; margin-bottom: 29px; }
.reader-symbol { width: 39px; height: 39px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--accent); }
.reader-strip strong { display: block; font-size: 15px; font-weight: 600; }
.reader-strip small { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.reader-strip small::before { content: ''; width: 6px; height: 6px; background: #a4aeae; border-radius: 50%; }
.reader-strip-end { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 13px; color: var(--accent); }
.reader-strip-end svg { width: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { font-size: 19px; }
.section-heading > span { font-size: 13px; color: var(--muted); }
.section-heading select { min-width: 0; max-width: 55%; }
.home-reading { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.reading-focus { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; align-items: center; }
.focus-book { display: flex; align-items: center; gap: 22px; min-width: 0; }
.focus-cover { width: 110px; flex: 0 0 110px; padding: 0; }
.focus-cover .cover-placeholder { padding: 10px; }
.focus-cover .cover-placeholder span { display: none; }
.focus-copy { min-width: 0; }
.reading-kicker { color: var(--accent); font-size: 12px; font-weight: 600; }
.focus-copy h2 { font-family: Georgia, serif; font-size: 27px; font-weight: 500; line-height: 1.25; margin-top: 9px; overflow-wrap: anywhere; }
.focus-copy p { font-size: 15px; color: var(--muted); line-height: 1.4; margin-top: 10px; overflow-wrap: anywhere; }
.focus-copy .text-link { min-height: 44px; font-size: 14px; margin-top: 10px; padding: 0; }
.reading-meter { display: flex; align-items: center; gap: 26px; }
.progress-ring { width: 170px; height: 170px; flex: 0 0 170px; border-radius: 50%; background: conic-gradient(from 0deg, var(--accent) var(--progress), var(--line) 0); display: grid; place-items: center; position: relative; }
.progress-ring::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--bg); }
.ring-center { position: relative; text-align: center; }
.ring-center strong { display: block; font-size: 40px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ring-center small { font-size: 20px; margin-left: 2px; font-weight: 500; }
.ring-center > span { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
.progress-ring.unknown strong { color: var(--muted); }
.reading-facts { display: grid; gap: 14px; font-size: 14px; color: var(--muted); min-width: 0; }
.reading-facts > div { display: flex; align-items: center; gap: 8px; }
.reading-facts svg { width: 18px; color: var(--accent); }
.reading-facts strong { color: var(--text); font-weight: 600; }
.progress-origin { font-size: 12px; color: var(--muted); }
.reading-footer { display: flex; gap: 12px; margin-top: 23px; grid-column: 1 / -1; }
.home-statistics { padding: 27px 0; border-bottom: 1px solid var(--line); }
.statistics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.statistic { display: grid; grid-template-columns: 34px 1fr; align-items: center; text-align: left; padding: 15px 18px; column-gap: 12px; border-left: 1px solid var(--line); min-width: 0; }
.statistic:first-child { border-left: 0; padding-left: 0; }
.statistic > strong { font-size: 31px; line-height: 1.3; font-weight: 650; font-variant-numeric: tabular-nums; }
.statistic > span:last-child { grid-column: 2; color: var(--muted); font-size: 14px; line-height: 1.4; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; align-self: start; margin-top: 4px; }
.metric-icon svg { width: 19px; height: 19px; }
.green .metric-icon { background: var(--accent-soft); color: var(--accent); }
.pink .metric-icon { background: var(--rose-soft); color: var(--rose); }
.gold .metric-icon { background: var(--ochre-soft); color: var(--ochre); }
.blue .metric-icon { background: #e8eef9; color: #5b78a9; }
.statistics-summary { display: flex; flex-wrap: wrap; gap: 16px 28px; padding-top: 22px; font-size: 13px; color: var(--muted); }
.statistics-summary > span { display: inline-flex; align-items: center; gap: 8px; }
.statistics-summary svg { width: 16px; height: 16px; }
.statistics-summary strong { color: var(--text); font-weight: 600; }
.home-next { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 27px; }
.home-next h2 { font-size: 18px; }
.home-next p { font-size: 14px; color: var(--muted); margin-top: 8px; }
.home-next .button { flex-shrink: 0; }
.home-empty { padding: 18px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.home-empty > svg { width: 38px; height: 38px; color: var(--accent); }
.home-empty h2 { font-size: 21px; }
.home-empty .text-link { min-height: 44px; }
.progress-dialog { width: min(420px, calc(100% - 32px)); border-radius: 8px; max-height: calc(100dvh - 40px); }
.progress-form { padding: 12px 24px 24px; }
.progress-form h2 { font-size: 22px; }
.progress-form > p { color: var(--muted); margin-top: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#progress-number { font-size: 26px; font-variant-numeric: tabular-nums; }
#progress-range { width: 100%; accent-color: var(--accent); min-height: 48px; margin: 12px 0; }
.reader-settings-status { display: flex; gap: 15px; align-items: center; padding: 0 0 20px; }
.reader-settings-status > svg { width: 28px; height: 28px; color: var(--accent); }
.reader-settings-status strong { display: block; font-size: 16px; }
.reader-settings-status p { color: var(--muted); font-size: 14px; margin-top: 5px; }
@media (max-width: 900px) { .reading-focus { gap: 24px; } .reading-meter { gap: 18px; } .progress-ring { width: 150px; height: 150px; flex-basis: 150px; } .reading-facts { font-size: 13px; } .statistic { padding-inline: 12px; gap: 9px; } }
@media (max-width: 760px) {
  .page-heading { margin-bottom: 22px; }
  .reader-strip { padding-block: 13px; margin-bottom: 23px; }
  .section-heading { margin-bottom: 18px; }
  .section-heading h2 { font-size: 18px; }
  .reading-focus { display: block; }
  .focus-book { gap: 16px; }
  .focus-cover { width: 72px; flex-basis: 72px; }
  .focus-copy h2 { font-size: 23px; margin-top: 6px; }
  .focus-copy p { font-size: 14px; margin-top: 7px; }
  .focus-copy .text-link { margin-top: 1px; min-height: 37px; }
  .reading-meter { justify-content: center; gap: 24px; padding: 20px 0; }
  .progress-ring { width: 152px; height: 152px; flex-basis: 152px; }
  .reading-facts { max-width: 130px; font-size: 13px; gap: 12px; }
  .reading-facts > div { align-items: flex-start; line-height: 1.4; }
  .reading-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 0; }
  .reading-footer .button { width: 100%; min-height: 62px; font-size: 14px; padding: 10px; }
  .reading-footer .button svg { width: 18px; height: 18px; }
  .home-reading { padding-bottom: 23px; }
  .home-statistics { padding-block: 24px; }
  .statistics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statistic { padding: 12px 0; gap: 10px; border-left: 0; }
  .statistic:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
  .statistic:nth-child(n+3) { border-top: 1px solid var(--line); }
  .statistic > strong { font-size: 29px; }
  .statistic > span:last-child { font-size: 13px; }
  .statistics-summary { gap: 14px; padding-top: 18px; }
  .statistics-summary > span { width: 100%; }
  .home-next { align-items: flex-start; }
  .home-next h2 { font-size: 17px; }
  .home-next p { font-size: 13px; line-height: 1.5; }
  .home-next .button { padding-inline: 12px; font-size: 13px; }
}
@media (max-width: 359px) { .bottom-nav button { font-size: 11px; } .reading-meter { gap: 16px; } .progress-ring { width: 138px; height: 138px; flex-basis: 138px; } .reading-facts { max-width: 125px; font-size: 12px; } .statistic { grid-template-columns: 28px 1fr; } .metric-icon { width: 28px; height: 32px; } .statistic > span:last-child { font-size: 12px; } }
html[data-theme=dark] .add-symbol { color: #173327; }
html[data-theme=dark] .blue .metric-icon { background: #303d52; color: #aec3ed; }
