/* News Reader — app styles */
:root {
  --bg: #f4f1ec;
  --card: #fcfbf9;
  --card-line: rgba(60, 45, 30, .10);
  --ink: #1d1a17;
  --ink-2: #6f6a64;
  --ink-3: #a09a93;
  --accent: #c2593f;
  --accent-ink: #fff;
  --tint: #f5e8de;
  --tint-ink: #3a1d10;
  --tint-line: rgba(120, 70, 40, .18);
  --shadow: 0 1px 2px rgba(50, 35, 20, .05), 0 8px 24px -12px rgba(50, 35, 20, .18);
  --glass: rgba(255, 255, 255, .58);
  --glass-line: rgba(255, 255, 255, .7);
  --glass-shadow: 0 10px 30px -8px rgba(40, 30, 20, .28), 0 2px 6px rgba(40, 30, 20, .08);
  --radius: 22px;
  --ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --serif: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-ui="light"]) {
    --bg: #131211; --card: #1d1b19; --card-line: rgba(255, 240, 220, .09); --ink: #f0ece6; --ink-2: #a8a199; --ink-3: #77716a;
    --accent: #e0795c; --tint: #2a211b; --tint-ink: #f3dfd0; --tint-line: rgba(255, 200, 160, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -14px rgba(0, 0, 0, .7);
    --glass: rgba(40, 37, 34, .62); --glass-line: rgba(255, 255, 255, .12); --glass-shadow: 0 10px 30px -8px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.35; }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(255, 255, 255, .12);
}

/* ---------- main views ---------- */
#app { max-width: 720px; margin: 0 auto; padding: calc(var(--sat) + 10px) calc(16px + var(--sar)) calc(var(--sab) + 120px) calc(16px + var(--sal)); }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 4px 14px; }
.view-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.view-head .sub { color: var(--ink-2); font-size: 13.5px; font-weight: 500; margin-top: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:active { background: var(--card-line); }
.icon-btn svg { width: 22px; height: 22px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ptr { height: 0; overflow: hidden; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; font-weight: 600; transition: height .18s ease; }
.ptr.on { height: 46px; }

/* ---------- cards ---------- */
.feed { display: flex; flex-direction: column; gap: 22px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; display: block; text-decoration: none; color: inherit; width: 100%; text-align: left; }
.card:active { transform: scale(.992); transition: transform .08s; }
.card .title { font-size: 21px; line-height: 1.24; font-weight: 500; letter-spacing: -.012em; margin: 0; text-wrap: pretty; overflow-wrap: anywhere; }
.card .excerpt { color: var(--ink-2); font-size: 15.5px; line-height: 1.38; margin: 8px 0 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.card.opened .title { color: var(--ink-2); }
.src { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 700; font-size: 15px; }
.src .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src .time { margin-left: auto; font-weight: 600; font-size: 14.5px; flex: none; font-variant-numeric: tabular-nums; padding-left: 10px; }
.src-icon { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; background: #fff; flex: none; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12); }
.src-icon.letter { display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800; box-shadow: none; }

.card.hero .pic { position: relative; aspect-ratio: 5 / 4; background: #d8d2c8; }
.card.hero .pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card.hero .pic::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 96px; background: linear-gradient(to bottom, rgba(0, 0, 0, .42), rgba(0, 0, 0, 0)); z-index: 1; }
.card.hero .src { position: absolute; z-index: 2; top: 15px; left: 16px; right: 16px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.card.hero .body { padding: 14px 18px 18px; }
.card.hero .excerpt { -webkit-line-clamp: 1; margin-top: 6px; }

.card.text { padding: 18px 18px 19px; }
.card.text .src { margin-bottom: 12px; font-size: 14.5px; }

.card.thumb { padding: 16px 18px 18px; }
.card.thumb .src { margin-bottom: 14px; }
.card.thumb .small { width: 104px; height: 104px; border-radius: 13px; object-fit: cover; display: block; margin-bottom: 14px; background: #d8d2c8; }
.card.thumb .excerpt { -webkit-line-clamp: 1; }

.card.bundle .head { padding: 15px 18px 13px; border-bottom: 1px solid var(--card-line); }
.card.bundle .head .domain { font-weight: 600; opacity: .55; }
.card.bundle .row { display: flex; gap: 14px; padding: 15px 18px; width: 100%; text-align: left; border-top: 1px solid var(--card-line); }
.card.bundle .row:first-of-type { border-top: 0; }
.card.bundle .row:active { background: var(--card-line); }
.card.bundle .row .txt { flex: 1; min-width: 0; }
.card.bundle .row .t { font-size: 18.5px; line-height: 1.27; font-weight: 500; letter-spacing: -.01em; text-wrap: pretty; overflow-wrap: anywhere; }
.card.bundle .row .m { color: var(--ink-2); font-size: 15px; line-height: 1.36; margin-top: 4px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.card.bundle .row .m b { font-weight: 500; font-variant-numeric: tabular-nums; }
.card.bundle .row img { width: 96px; height: 96px; border-radius: 13px; object-fit: cover; flex: none; background: #d8d2c8; }
.card.bundle .row.opened .t { color: var(--ink-2); }

.card.reading { background: var(--tint); color: var(--tint-ink); box-shadow: 0 0 0 1px var(--tint-line), var(--shadow); padding: 16px 18px 0; max-height: 330px; }
.card.reading .label { font-weight: 700; font-size: 14.5px; color: color-mix(in srgb, var(--tint-ink) 78%, var(--accent)); display: flex; align-items: center; justify-content: space-between; }
.card.reading .x { width: 34px; height: 34px; margin: -8px -8px -8px 0; display: grid; place-items: center; color: inherit; opacity: .8; }
.card.reading .x svg { width: 18px; height: 18px; }
.card.reading .small { width: 104px; height: 104px; border-radius: 13px; object-fit: cover; display: block; margin: 12px 0 0; }
.card.reading .title { font-size: 25px; font-weight: 800; line-height: 1.16; letter-spacing: -.022em; margin-top: 16px; }
.card.reading .lede { font-family: var(--serif); font-size: 17px; line-height: 1.55; margin: 12px 0 0; padding-bottom: 10px; }
.card.reading .lede .dom { opacity: .5; }
.card.reading::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background: linear-gradient(to bottom, transparent, var(--tint)); pointer-events: none; }

.empty { text-align: center; color: var(--ink-2); padding: 56px 24px; font-size: 15.5px; line-height: 1.5; }
.empty b { display: block; color: var(--ink); font-size: 19px; margin-bottom: 6px; }
.more { display: grid; place-items: center; padding: 26px; color: var(--ink-3); }

/* ---------- lists (latest, library, sources) ---------- */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list .row { display: flex; gap: 13px; align-items: center; padding: 13px 16px; width: 100%; text-align: left; border-top: 1px solid var(--card-line); min-height: 56px; }
.list .row:first-child { border-top: 0; }
.list .row:active { background: var(--card-line); }
.list .row .txt { flex: 1; min-width: 0; }
.list .row .t { font-size: 16.5px; font-weight: 500; line-height: 1.28; letter-spacing: -.008em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.list .row .m { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .row .m .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.list .row img.th { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; flex: none; background: #d8d2c8; }
.list .row.opened .t { color: var(--ink-2); }
.list .row .end { color: var(--ink-3); flex: none; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.list .row .end svg { width: 18px; height: 18px; }
.group-title { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin: 22px 6px 9px; }
.bar { height: 3px; border-radius: 2px; background: var(--card-line); margin-top: 7px; overflow: hidden; max-width: 120px; }
.bar i { display: block; height: 100%; background: var(--accent); }

.seg { display: flex; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 12px; padding: 3px; margin: 0 0 16px; }
.seg button { flex: 1; padding: 8px 6px; border-radius: 9.5px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.field { display: flex; gap: 8px; margin: 0 0 16px; }
.field input { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--card-line); border-radius: 13px; padding: 12px 14px; font-size: 16px; outline: none; }
.field input:focus { border-color: var(--accent); }
.btn { background: var(--accent); color: var(--accent-ink); border-radius: 13px; padding: 12px 17px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.btn.quiet { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.btn.danger { background: color-mix(in srgb, #c62828 12%, transparent); color: #c62828; }
.btn:disabled { opacity: .5; }
.btn.block { display: block; width: 100%; text-align: center; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 10px); display: flex; gap: 2px; padding: 6px; border-radius: 36px; width: min(calc(100vw - 28px), 430px); transition: transform .28s cubic-bezier(.3, .7, .2, 1), opacity .2s; }
.tabbar.away { transform: translateX(-50%) translateY(140%); opacity: 0; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 7px; border-radius: 30px; font-size: 11.5px; font-weight: 700; color: var(--ink); letter-spacing: -.005em; }
.tabbar button svg { width: 25px; height: 25px; }
.tabbar button.on { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--accent); }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(20, 14, 8, .32); opacity: 0; transition: opacity .22s; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 620px; max-height: min(88dvh, 88vh); background: var(--bg); color: var(--ink); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); transform: translateY(102%); transition: transform .3s cubic-bezier(.25, .8, .25, 1); display: flex; flex-direction: column; font-family: var(--ui); }
.sheet.on { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--ink-3); opacity: .5; margin: 9px auto 2px; flex: none; }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 8px 20px; flex: none; }
.sheet .sheet-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.015em; }
.sheet .sheet-body { overflow: auto; -webkit-overflow-scrolling: touch; padding: 4px 18px calc(var(--sab) + 26px); overscroll-behavior: contain; }
.sheet h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); margin: 22px 4px 9px; font-weight: 700; }
.sheet p.help { color: var(--ink-2); font-size: 13.5px; line-height: 1.45; margin: 8px 4px 0; }
.sheet p.help a { color: var(--accent); }
.set { background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px var(--card-line); }
.set > .r { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border-top: 1px solid var(--card-line); min-height: 50px; font-size: 15.5px; width: 100%; text-align: left; }
.set > .r:first-child { border-top: 0; }
.set > .r .l { flex: 1; min-width: 0; }
.set > .r .l small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; line-height: 1.35; }
.set > .r .v { color: var(--ink-2); font-size: 14.5px; flex: none; font-variant-numeric: tabular-nums; }
.set > .r select, .set > .r input[type="text"], .set > .r input[type="password"], .set > .r input[type="number"] { background: color-mix(in srgb, var(--ink) 6%, transparent); border: 0; border-radius: 9px; padding: 8px 10px; font-size: 15px; max-width: 58%; min-width: 0; outline: none; }
.set > .r input[type="text"].wide, .set > .r input[type="password"].wide { max-width: none; flex: 1; }
.set > .r input[type="range"] { flex: 1.4; accent-color: var(--accent); min-width: 0; }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: color-mix(in srgb, var(--ink) 16%, transparent); position: relative; flex: none; transition: background .2s; cursor: pointer; margin: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch:checked { background: #34a853; }
.switch:checked::after { transform: translateX(20px); }
.swatches { display: flex; gap: 10px; padding: 13px 15px; flex-wrap: wrap; }
.swatch { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .14); display: grid; place-items: center; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.swatch.on { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px var(--accent); }
.dots { display: flex; gap: 12px; padding: 13px 15px; flex-wrap: wrap; }
.dotpick { width: 34px; height: 34px; border-radius: 50%; position: relative; }
.dotpick.off { opacity: .28; }
.dotpick.def::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }
.attempts { font-size: 13.5px; width: 100%; border-collapse: collapse; }
.attempts td { padding: 8px 6px; border-top: 1px solid var(--card-line); vertical-align: top; }
.attempts tr:first-child td { border-top: 0; }
.attempts .ok { color: #2e7d32; font-weight: 700; }
.attempts .no { color: var(--ink-2); }
.attempts .bad { color: #c62828; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 15px; }
.chip { padding: 8px 13px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); font-size: 13.5px; font-weight: 600; }
.chip:active { background: color-mix(in srgb, var(--ink) 16%, transparent); }

.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--sab) + 104px); transform: translate(-50%, 20px); opacity: 0; padding: 11px 17px; border-radius: 16px; font-size: 14.5px; font-weight: 600; max-width: min(88vw, 420px); text-align: center; transition: opacity .22s, transform .22s; pointer-events: none; color: var(--ink); font-family: var(--ui); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- login ---------- */
.login { min-height: 82vh; display: grid; place-items: center; }
.login form { width: min(100%, 360px); text-align: center; }
.login .mark { width: 76px; height: 76px; border-radius: 20px; margin: 0 auto 22px; display: block; box-shadow: var(--shadow); }
.login h1 { font-size: 26px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.02em; }
.login p { color: var(--ink-2); margin: 0 0 22px; font-size: 15px; }
.login input { width: 100%; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 14px 16px; font-size: 17px; outline: none; margin-bottom: 12px; text-align: center; }
.login .err { color: #c62828; font-size: 14px; min-height: 20px; margin-top: 12px; }

/* ---------- reader ---------- */
.reader {
  --r-bg: #f8ece1; --r-ink: #2a1c12; --r-ink2: #8a7a6c; --r-link: #c2593f; --r-line: rgba(90, 55, 30, .16);
  --r-body: 'Source Serif 4', Georgia, serif; --r-head: 'Inter', system-ui, sans-serif;
  --r-size: 19px; --r-lh: 1.6; --r-margin: 22px; --r-max: 680px; --r-para: .9em; --r-align: start; --r-hyph: auto;
  position: fixed; inset: 0; z-index: 40; background: var(--r-bg); color: var(--r-ink);
  transform: translateX(100%); transition: transform .32s cubic-bezier(.22, .8, .24, 1); will-change: transform;
}
.reader.on { transform: none; }
.reader[data-theme="white"] { --r-bg: #ffffff; --r-ink: #161616; --r-ink2: #7a7a7a; --r-link: #b6492f; --r-line: rgba(0, 0, 0, .12); }
.reader[data-theme="paper"] { --r-bg: #f8ece1; --r-ink: #2a1c12; --r-ink2: #8a7a6c; }
.reader[data-theme="sepia"] { --r-bg: #f1e3c8; --r-ink: #3b2a17; --r-ink2: #8c7757; --r-link: #a5492a; --r-line: rgba(90, 60, 20, .2); }
.reader[data-theme="sand"] { --r-bg: #e9dfd0; --r-ink: #2e2a24; --r-ink2: #7d7466; --r-link: #9c4a2c; --r-line: rgba(60, 50, 30, .2); }
.reader[data-theme="dark"] { --r-bg: #1c1a18; --r-ink: #e6dfd6; --r-ink2: #8f867b; --r-link: #e58a6c; --r-line: rgba(255, 240, 220, .14); color-scheme: dark; }
.reader[data-theme="black"] { --r-bg: #000; --r-ink: #d9d4cc; --r-ink2: #7d766c; --r-link: #e58a6c; --r-line: rgba(255, 255, 255, .16); color-scheme: dark; }
.reader .scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.reader .page { max-width: calc(var(--r-max) + 2 * var(--r-margin)); margin: 0 auto; padding: calc(var(--sat) + 34px) calc(var(--r-margin) + var(--sar)) calc(var(--sab) + 150px) calc(var(--r-margin) + var(--sal)); }
.reader .progress { position: absolute; z-index: 3; top: 0; left: 0; height: 2.5px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--r-link); opacity: .75; }
.reader h1.title { font-family: var(--r-head); font-size: calc(var(--r-size) * 1.62); line-height: 1.12; font-weight: 800; letter-spacing: -.024em; margin: 0 0 .5em; text-wrap: balance; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.reader .byline { font-family: var(--r-body); color: var(--r-ink2); font-weight: 600; font-size: calc(var(--r-size) * .9); margin: 0 0 1.5em; line-height: 1.4; }
.reader .content { font-family: var(--r-body); font-size: var(--r-size); line-height: var(--r-lh); text-align: var(--r-align); -webkit-hyphens: var(--r-hyph); hyphens: var(--r-hyph); hyphenate-limit-chars: 6 3 3; -webkit-hyphenate-limit-before: 3; -webkit-hyphenate-limit-after: 3; text-wrap: pretty; overflow-wrap: break-word; font-optical-sizing: auto; font-kerning: normal; -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.reader .content > *:first-child { margin-top: 0; }
.reader .content p { margin: 0 0 var(--r-para); }
.reader .content h2, .reader .content h3, .reader .content h4, .reader .content h5, .reader .content h6 { font-family: var(--r-head); line-height: 1.2; letter-spacing: -.015em; margin: 1.7em 0 .6em; text-align: start; -webkit-hyphens: manual; hyphens: manual; text-wrap: balance; }
.reader .content h2 { font-size: 1.32em; font-weight: 800; }
.reader .content h3 { font-size: 1.14em; font-weight: 750; }
.reader .content h4, .reader .content h5, .reader .content h6 { font-size: 1em; font-weight: 700; }
.reader .content a { color: var(--r-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2.5px; }
.reader .content figure { margin: 1.5em 0; text-align: start; }
.reader .content img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--r-line); }
.reader .content figcaption { font-family: var(--r-head); font-size: .7em; line-height: 1.4; color: var(--r-ink2); margin-top: .65em; -webkit-hyphens: manual; hyphens: manual; text-align: start; }
.reader .content blockquote { margin: 1.4em 0; padding: 0 0 0 1em; border-left: 3px solid var(--r-link); font-style: italic; }
.reader .content blockquote p:last-child { margin-bottom: 0; }
.reader .content ul, .reader .content ol { padding-left: 1.3em; margin: 0 0 var(--r-para); }
.reader .content li { margin-bottom: .35em; }
.reader .content pre, .reader .content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82em; }
.reader .content pre { overflow-x: auto; padding: 14px; background: var(--r-line); border-radius: 10px; text-align: start; -webkit-hyphens: none; hyphens: none; }
.reader .content table { border-collapse: collapse; font-size: .82em; font-family: var(--r-head); display: block; overflow-x: auto; margin: 1.4em 0; text-align: start; -webkit-hyphens: manual; hyphens: manual; }
.reader .content td, .reader .content th { border: 1px solid var(--r-line); padding: 6px 10px; }
.reader .content hr { border: 0; border-top: 1px solid var(--r-line); margin: 2em 0; }
.reader .content .nr-embed { font-family: var(--r-head); font-size: .8em; padding: 12px 14px; border: 1px solid var(--r-line); border-radius: 12px; }
.reader .endmark { margin: 2.6em auto 0; width: 44px; height: 3px; border-radius: 2px; background: var(--r-line); }
.reader .notice { font-family: var(--ui); font-size: 14px; line-height: 1.45; padding: 13px 15px; border-radius: 14px; background: color-mix(in srgb, var(--r-link) 12%, transparent); margin: 0 0 1.6em; }
.reader .notice b { display: block; margin-bottom: 2px; }
.reader .notice button { color: var(--r-link); font-weight: 700; margin-top: 6px; }
.reader .state { display: grid; place-items: center; min-height: 60vh; text-align: center; color: var(--r-ink2); font-family: var(--ui); gap: 14px; padding: 0 20px; }
.reader .state svg { width: 30px; height: 30px; }
.skeleton i { display: block; height: .95em; border-radius: 6px; background: var(--r-line); margin: 0 0 .75em; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* highlights (Zotero's colours) */
mark.hl { color: inherit; border-radius: 3px; padding: .08em 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; cursor: pointer; background: var(--hl); }
.hl-yellow { --hl: rgba(255, 212, 0, .5); } .hl-red { --hl: rgba(255, 102, 102, .45); } .hl-green { --hl: rgba(95, 178, 54, .42); } .hl-blue { --hl: rgba(46, 168, 229, .4); }
.hl-purple { --hl: rgba(162, 138, 229, .45); } .hl-magenta { --hl: rgba(229, 110, 238, .42); } .hl-orange { --hl: rgba(241, 152, 55, .48); } .hl-gray { --hl: rgba(170, 170, 170, .5); }
.reader[data-theme="dark"] mark.hl, .reader[data-theme="black"] mark.hl { --hl-mix: 62%; background: color-mix(in srgb, var(--hl) var(--hl-mix), transparent); }
mark.hl.note { text-decoration: underline dotted; text-underline-offset: 3px; }
.c-yellow { background: #ffd400; } .c-red { background: #ff6666; } .c-green { background: #5fb236; } .c-blue { background: #2ea8e5; }
.c-purple { background: #a28ae5; } .c-magenta { background: #e56eee; } .c-orange { background: #f19837; } .c-gray { background: #aaaaaa; }

/* reader chrome */
.rbar { position: absolute; z-index: 5; left: 50%; bottom: calc(var(--sab) + 12px); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 30px; transition: transform .3s cubic-bezier(.3, .7, .2, 1), opacity .22s; color: var(--r-ink); }
.rbar button { width: 48px; height: 44px; border-radius: 24px; display: grid; place-items: center; }
.rbar button:active { background: var(--r-line); }
.rbar button svg { width: 23px; height: 23px; }
.reader.chrome-off .rbar { transform: translateX(-50%) translateY(170%); opacity: 0; }
.reader[data-theme="dark"] .glass, .reader[data-theme="black"] .glass { --glass: rgba(48, 44, 40, .6); --glass-line: rgba(255, 255, 255, .13); --glass-shadow: 0 10px 30px -8px rgba(0, 0, 0, .7); box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .16); }

.save-fab { position: absolute; z-index: 6; right: calc(var(--sar) + 18px); bottom: calc(var(--sab) + 82px); width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: var(--r-ink); transition: transform .32s cubic-bezier(.3, 1.3, .5, 1), opacity .3s, bottom .3s cubic-bezier(.3, .7, .2, 1); }
.reader.chrome-off .save-fab { bottom: calc(var(--sab) + 22px); }
.save-fab::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(120% 120% at 28% 18%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%); pointer-events: none; }
.save-fab svg { width: 26px; height: 26px; position: relative; }
.save-fab .ring { position: absolute; inset: -1px; border-radius: 50%; border: 2.5px solid transparent; border-top-color: var(--r-link); border-right-color: var(--r-link); opacity: 0; }
.save-fab.saving .ring { opacity: 1; animation: spin .9s linear infinite; }
.save-fab.saving .ico-plus { transform: scale(.8); opacity: .5; }
.save-fab .ico-plus, .save-fab .ico-check, .save-fab .ico-warn { grid-area: 1 / 1; transition: transform .28s cubic-bezier(.3, 1.4, .5, 1), opacity .2s; }
.save-fab .ico-check, .save-fab .ico-warn { transform: scale(.3) rotate(-30deg); opacity: 0; }
.save-fab.done { color: #2e7d32; }
.save-fab.done .ico-plus { transform: scale(.3) rotate(90deg); opacity: 0; }
.save-fab.done .ico-check { transform: none; opacity: 1; }
.save-fab.gone { transform: scale(.4); opacity: 0; pointer-events: none; }
.save-fab.warn { color: #c62828; }
.save-fab.warn .ico-plus { opacity: 0; }
.save-fab.warn .ico-warn { transform: none; opacity: 1; }
.save-fab:active { transform: scale(.93); }

/* the colour bar under a selection */
.hlbar { position: fixed; z-index: 70; padding: 6px 8px; border-radius: 27px; opacity: 0; transform: translateY(6px) scale(.96); transition: opacity .16s, transform .18s cubic-bezier(.3, 1.3, .5, 1); pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; color: var(--ink); max-width: calc(100vw - 16px); }
.hlbar.on { opacity: 1; transform: none; pointer-events: auto; }
.hlbar .line { display: flex; align-items: center; justify-content: center; }
.hlbar button { width: 40px; height: 42px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.hlbar button i { width: 26px; height: 26px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .15); }
.hlbar button.cur i { box-shadow: 0 0 0 2.5px var(--glass-line), 0 0 0 4.5px currentColor; }
.hlbar.edit { border-radius: 24px; padding-bottom: 4px; }
.hlbar .acts { border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); margin-top: 4px; padding-top: 2px; justify-content: space-around; }
.hlbar .acts button { width: auto; height: 42px; padding: 0 12px; border-radius: 14px; display: flex; gap: 7px; align-items: center; font-size: 13.5px; font-weight: 600; font-family: var(--ui); }
.hlbar .acts button:active { background: color-mix(in srgb, currentColor 12%, transparent); }
.hlbar button svg { width: 20px; height: 20px; }
.hlbar.dark { --glass: rgba(48, 44, 40, .66); --glass-line: rgba(255, 255, 255, .14); color: #eee; }

textarea.note { width: 100%; min-height: 130px; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 13px 14px; font-size: 16px; line-height: 1.45; outline: none; resize: vertical; }
blockquote.quote { margin: 4px 0 14px; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent); color: var(--ink-2); font-family: var(--serif); font-size: 15.5px; line-height: 1.45; max-height: 7.3em; overflow: hidden; }

@media (min-width: 760px) {
  .card .title { font-size: 23px; }
  .card.hero .pic { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
