/* ============================================================
   Inkshelf — tab screens: Favorites · Recent · Downloads · Account
   Everything is scoped to the page classes (or to sheets these views open).
   ============================================================ */
:root {
  --liquid-hi: rgba(255, 255, 255, .85);     /* specular top edge */
  --liquid-sheen: rgba(255, 255, 255, .55);
  --liquid-tint: rgba(255, 255, 255, .42);
  --blob-a: rgba(255, 122, 92, .38);
  --blob-b: rgba(224, 86, 138, .26);
}
:root:where([data-scheme="dark"], [data-scheme="amoled"]) {
  --liquid-hi: rgba(255, 255, 255, .16);
  --liquid-sheen: rgba(255, 255, 255, .07);
  --liquid-tint: rgba(40, 37, 34, .45);
  --blob-a: rgba(240, 80, 42, .34);
  --blob-b: rgba(224, 86, 138, .2);
}

:is(.favorites-page, .recent-page, .downloads-page, .account-page) .wrap { max-width: 720px; }

/* header text action ("Clear") */
.recent-page .header-text-btn {
  height: 44px; padding: 0 12px; border-radius: 22px;
  color: var(--accent-light); font-size: 16px;
}
.recent-page .header-text-btn:active { background: rgba(127, 127, 127, .14); }

.tab-count { margin: 16px 0 14px; font-size: 13px; color: var(--muted); }
.tab-section-title { margin: 24px 0 2px; font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Favorites ---------- */
.favorites-page .card-sub.is-new { color: var(--accent-light); font-weight: 500; }
.favorites-page .card-sub.is-new::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; vertical-align: 2px;
  border-radius: 50%; background: var(--accent-light);
}

/* ---------- Recent ---------- */
.recent-group-title { margin: 22px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.recent-page .list-row { gap: 8px; }
.recent-page .list-row:last-child { border-bottom: 0; }
.recent-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.recent-page .thumb, .downloads-page .thumb { width: 58px; }
.recent-time { font-size: 12px; }
/* "Read to Ch.12 · p.4" may wrap to two lines instead of being cut off next to Continue */
.recent-page .list-row-sub.ellipsis { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.recent-continue { height: 30px; padding: 0 12px; font-size: 14px; flex-shrink: 0; }
.recent-continue:active { background: var(--accent-soft); }
.recent-remove { width: 36px; height: 36px; color: var(--muted); flex-shrink: 0; margin-right: -8px; }
.recent-remove .icon { width: 18px; height: 18px; }

/* ---------- liquid glass card (Downloads summary / Account profile) ---------- */
.glass-stage { position: relative; margin-top: 18px; isolation: isolate; }
.glass-stage::before, .glass-stage::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(28px); pointer-events: none;
}
.glass-stage::before { width: 58%; height: 120%; left: -6%; top: -18%; background: var(--blob-a); }
.glass-stage::after { width: 46%; height: 100%; right: -4%; bottom: -14%; background: var(--blob-b); }
.liquid-card {
  position: relative; overflow: hidden;
  padding: 18px; border-radius: 22px;
  background: linear-gradient(145deg, var(--liquid-sheen), transparent 55%), var(--liquid-tint);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--liquid-hi), inset 0 -1px 0 var(--glass-edge), var(--glass-shadow);
}
.liquid-card::before { /* curved specular highlight */
  content: ""; position: absolute; left: -20%; right: -20%; top: -60%; height: 100%;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, var(--liquid-sheen), transparent 70%);
}
.liquid-card > * { position: relative; }

/* ---------- Downloads ---------- */
.summary-top { display: flex; align-items: center; gap: 14px; }
.summary-badge {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; flex-shrink: 0;
  color: #fff; background: linear-gradient(150deg, var(--accent-light), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 16px rgba(214, 54, 15, .3);
}
.summary-value { font-size: 26px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.summary-label { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.summary-stat, .stat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px;
  background: var(--liquid-sheen); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--liquid-hi);
}
.summary-stat b { font-size: 18px; font-weight: 600; color: var(--pink); }
.summary-stat span { font-size: 12px; color: var(--text-2); }

.downloads-page .list-row:last-child { border-bottom: 0; }
.dl-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.dl-delete { color: var(--muted); flex-shrink: 0; margin-right: -10px; }
.dl-delete .icon { width: 22px; height: 22px; }
.dl-delete:active { color: #e03131; }

.wifi-link { color: var(--muted); font-size: 16px; padding: 6px 4px; }
.wifi-link:active { color: var(--text-2); }
.dl-footer-link { display: block; margin: 18px auto 0; font-size: 14px; }

/* empty state: cloud with download arrow, ground dashes, sparkles (like the reference) */
.downloads-empty { padding-top: 24vh; }
.downloads-empty .empty-illus {
  position: relative; width: 170px; height: 132px; border-radius: 50% 50% 0 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(127, 127, 127, .12) 0 55%, transparent 56%);
  margin-bottom: 30px;
}
.downloads-empty .empty-illus > .icon:first-child { width: 112px; height: 112px; color: #b9b9be; }
.downloads-empty .empty-arrow {
  position: absolute; left: 50%; top: 50px; transform: translateX(-50%);
  width: 38px; height: 38px; color: #b9b9be;
}
.downloads-empty .empty-arrow svg path:last-child { display: none; } /* no baseline under the arrow */
.downloads-empty .empty-ground {
  position: absolute; left: -10px; right: -10px; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, #cfcfd3 0 7%, transparent 7% 11%, #cfcfd3 11% 54%, transparent 54% 58%, #cfcfd3 58% 63%, transparent 63% 66%, #cfcfd3 66% 93%, transparent 93% 96%, #cfcfd3 96%);
}
.downloads-empty .empty-ground::after {
  content: ""; position: absolute; left: 42%; right: 12%; top: 16px; height: 2px;
  background: linear-gradient(90deg, #d6d6da 0 12%, transparent 12% 18%, #d6d6da 18% 82%, transparent 82% 88%, #d6d6da 88%);
}
.downloads-empty .empty-spark {
  position: absolute; right: 26px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #c4c4c8;
  box-shadow: 14px 26px 0 -1px #d0d0d4, -96px 76px 0 0 #c9c9cd, 4px 70px 0 -2px #d0d0d4;
}
.downloads-empty .empty-title { font-size: 21px; margin-bottom: 14px; }
:where(html[data-scheme="dark"], html[data-scheme="amoled"]) .downloads-empty .empty-illus > .icon:first-child,
:where(html[data-scheme="dark"], html[data-scheme="amoled"]) .downloads-empty .empty-arrow { color: #5c5c64; }
:where(html[data-scheme="dark"], html[data-scheme="amoled"]) .downloads-empty .empty-ground { filter: brightness(.42); }
:where(html[data-scheme="dark"], html[data-scheme="amoled"]) .downloads-empty .empty-illus { background: radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, .05) 0 55%, transparent 56%); }
:where(html[data-scheme="dark"], html[data-scheme="amoled"]) .downloads-empty .empty-spark { background: #4a4540; box-shadow: 14px 26px 0 -1px #44444b, -96px 76px 0 0 #4a4540, 4px 70px 0 -2px #44444b; }

/* offline help sheet */
.offline-help { padding: 0 4px 4px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.offline-help p { margin: 0 0 12px; }
.offline-help .muted { font-size: 13.5px; }
.offline-help-icon {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px;
  color: var(--accent-light); background: var(--accent-soft);
}
.offline-help-icon .icon { width: 36px; height: 36px; }
.offline-sheet .sheet-footer .btn-outline { flex: 1; }

/* ---------- Account ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.avatar {
  display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0;
  font-size: 27px; font-weight: 600; color: #fff;
  background: linear-gradient(150deg, var(--accent-light), var(--accent) 55%, var(--pink));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 8px 20px rgba(214, 54, 15, .3);
  border: 2px solid var(--glass-border);
}
.profile-text { min-width: 0; }
.profile-name { display: flex; align-items: center; gap: 6px; font-size: 21px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-edit { width: 17px; height: 17px; color: var(--muted); }
.profile-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat-value { font-size: 22px; font-weight: 600; color: var(--pink); line-height: 1.15; }
.stat-label { font-size: 12px; color: var(--text-2); text-align: center; }

.settings-group { margin-top: 24px; }
.settings-group-title { margin: 0 4px 8px; font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
/* Capitals spaced out read as shouting in Mongolian Cyrillic: sentence case there. */
html:lang(mn) :is(.settings-group-title, .recent-group-title, .tab-section-title) { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }
.settings-card { border-radius: 16px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.account-page .settings-row { width: 100%; padding: 0 12px 0 14px; min-height: 54px; text-align: left; gap: 12px; }
.account-page .settings-row:last-child { border-bottom: 0; }
.account-page .settings-row:active { background: rgba(127, 127, 127, .08); }
.settings-row .list-row-main { font-size: 16px; }
.settings-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  color: var(--accent-light); background: var(--accent-soft);
}
.settings-icon .icon { width: 19px; height: 19px; }
.settings-row.is-danger .settings-icon { color: #e03131; background: rgba(224, 49, 49, .1); }
.settings-value { font-size: 14px; color: var(--muted); white-space: nowrap; }
.settings-chevron { width: 16px; height: 16px; color: var(--muted); opacity: .7; }

/* reader settings sheet */
.reader-settings .sheet-section-title { text-align: left; font-size: 14px; color: var(--muted); margin: 18px 2px 10px; }
.reader-settings .settings-field:first-child .sheet-section-title { margin-top: 4px; }
.reader-settings .chip.pill { font-size: 15px; }
.appearance-settings .chip.pill { white-space: nowrap; padding-left: 6px; padding-right: 6px; font-size: 14.5px; }
.range-row { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 0 2px 6px; }
.range-row .icon { width: 22px; height: 22px; }
.range { flex: 1; accent-color: var(--accent); }
.range-value { width: 42px; text-align: right; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* about sheet */
.about-body { text-align: center; padding: 0 8px 8px; color: var(--text-2); }
.about-logo { display: block; width: 72px; height: 72px; margin: 0 auto 10px; filter: drop-shadow(0 8px 18px rgba(214, 54, 15, .35)); }
.about-name { font-size: 20px; font-weight: 600; color: var(--text); }
.about-tag { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.about-body p { margin: 0 auto; max-width: 380px; font-size: 15px; line-height: 1.55; }
