/* ============================================================
   Commonplace — iOS-flavoured design system
   ============================================================ */
:root {
  /* surfaces — neutrals carry a faint violet bias so they sit under the accent, not beside it */
  --bg: #f4f3f7;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-2: #f8f7fb;
  --hairline: rgba(30,24,50,0.07);
  --fill: rgba(118,118,128,0.12);
  --fill-2: rgba(118,118,128,0.08);
  /* text */
  --label: #14121a;
  --label-2: rgba(60,56,75,0.64);
  --label-3: rgba(60,56,75,0.36);
  --separator: rgba(60,56,75,0.14);
  /* accents */
  --blue: #007aff;
  --purple: #af52de;
  --pink: #ff2d55;
  --orange: #ff9500;
  --green: #34c759;
  --yellow: #ffcc00;
  --teal: #30b0c7;
  --red: #ff3b30;
  --tint: var(--pink);
  --grad: linear-gradient(135deg, #ff9f0a 0%, #ff375f 48%, #bf5af2 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,159,10,0.14), rgba(255,55,95,0.14) 48%, rgba(191,90,242,0.14));
  /* type */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "New York", "Iowan Old Style", Charter, Palatino, Georgia, serif;
  --display: "Newsreader", "New York", "Iowan Old Style", Charter, Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  /* metrics */
  --r-card: 20px;
  --r-field: 14px;
  --r-chip: 999px;
  --shadow-1: 0 1px 1px rgba(20,16,40,0.03), 0 4px 12px -6px rgba(20,16,40,0.10);
  --shadow-2: 0 2px 6px rgba(20,16,40,0.06), 0 20px 44px -18px rgba(20,16,40,0.26);
  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* highlighter inks */
  --hl-yellow: #ffe066; --hl-green: #b8e986; --hl-blue: #9ed0ff; --hl-pink: #ffb3c7; --hl-orange: #ffc78a;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0b0a0e;
  --bg-elev: #17161c;
  --card: #17161c;
  --card-2: #201f27;
  --hairline: rgba(255,255,255,0.07);
  --fill: rgba(120,120,128,0.24);
  --fill-2: rgba(120,120,128,0.16);
  --label: #f5f3f8;
  --label-2: rgba(235,232,245,0.64);
  --label-3: rgba(235,232,245,0.36);
  --separator: rgba(120,116,140,0.28);
  --blue: #0a84ff; --purple: #bf5af2; --pink: #ff375f; --orange: #ff9f0a;
  --green: #30d158; --yellow: #ffd60a; --teal: #40cbe0; --red: #ff453a;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.5), 0 8px 20px -10px rgba(0,0,0,0.8);
  --shadow-2: 0 2px 8px rgba(0,0,0,0.6), 0 24px 48px -20px rgba(0,0,0,0.9);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  font-size: 17px; line-height: 1.45;
  color: var(--label);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 12% -12%, rgba(255,179,64,0.10), transparent 62%),
    radial-gradient(900px 460px at 92% -6%, rgba(163,92,240,0.11), transparent 58%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
html[data-theme="dark"] body {
  background-image:
    radial-gradient(1100px 520px at 12% -12%, rgba(255,179,64,0.09), transparent 62%),
    radial-gradient(900px 460px at 92% -6%, rgba(163,92,240,0.13), transparent 58%);
}
h1,h2,h3,h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--tint); text-decoration: none; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--label-2); }
.small { font-size: 13px; }
.serif { font-family: var(--serif); }
::selection { background: rgba(255,55,95,0.22); }

/* ---------- App layout ---------- */
.view { min-height: 100%; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); }
.page { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.page.wide { max-width: 1080px; }

.large-title {
  padding: 14px 0 6px;
  display: flex; align-items: flex-end; gap: 12px;
}
.large-title h1 {
  font-family: var(--display); font-size: 36px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.05; text-wrap: balance;
}
.large-title .grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.large-title .spacer { flex: 1; }
.subtitle { color: var(--label-2); font-size: 15px; margin: -2px 0 12px; }

/* ---------- Buttons ---------- */
.btn {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  padding: 9px 16px; border-radius: var(--r-chip); border: 0;
  background: var(--fill); color: var(--label);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  transition: transform .12s cubic-bezier(.2,.8,.3,1), opacity .15s, background .15s;
}
.btn:active { transform: scale(.96); }
.btn.tint { background: var(--tint); color: #fff; }
.btn.grad { background-image: var(--grad); color: #fff; }
.btn.plain { background: transparent; color: var(--tint); padding: 9px 8px; }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; }
.btn.sm { font-size: 14px; padding: 7px 13px; }
.btn:disabled { opacity: .4; cursor: default; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--fill);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--label);
  transition: transform .12s, background .15s; flex: none;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.on { background: var(--tint); color: #fff; }
.icon-btn svg { width: 19px; height: 19px; fill: currentColor; }
.icon-btn.ghost { background: transparent; }
.icon-btn.ghost:hover { background: var(--fill); }

/* Floating compose button */
.fab {
  position: fixed; right: 20px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px);
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background-image: var(--grad); color: #fff; z-index: 40;
  box-shadow: 0 8px 24px -6px rgba(255,55,95,0.5), 0 2px 6px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s cubic-bezier(.2,.9,.3,1.2);
}
.fab:active { transform: scale(.9); }
.fab svg { width: 26px; height: 26px; fill: #fff; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; align-items: stretch;
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
  backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 0.5px solid var(--separator);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--label-3); font-size: 10px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none;
  transition: color .15s;
}
.tabbar a svg { width: 24px; height: 24px; fill: currentColor; transition: transform .18s cubic-bezier(.2,.9,.3,1.3); }
.tabbar a.active { color: var(--tint); }
.tabbar a.active svg { transform: translateY(-1px) scale(1.06); }
.tabbar a:active svg { transform: scale(.88); }
@media (min-width: 860px) {
  .tabbar {
    left: 50%; right: auto; transform: translateX(-50%);
    bottom: 16px; height: 56px; padding: 6px; border-radius: 999px; border: 0.5px solid var(--separator);
    box-shadow: var(--shadow-2); width: auto; gap: 4px;
  }
  .tabbar a { flex-direction: row; gap: 8px; padding: 0 18px; border-radius: 999px; font-size: 14px; }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a.active { background: var(--fill); }
  .view { padding-bottom: 92px; }
}

/* ---------- Search & segmented ---------- */
.searchbar { position: relative; margin-bottom: 12px; }
.searchbar svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: var(--label-3); pointer-events: none; }
.searchbar input {
  width: 100%; border: 0; border-radius: 12px; background: var(--fill);
  padding: 10px 12px 10px 34px; font-size: 16px; outline: none;
}
.searchbar input::placeholder { color: var(--label-3); }
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  border: 0; border-radius: var(--r-chip); padding: 7px 14px; font-size: 14px; font-weight: 600;
  background: var(--fill); color: var(--label); cursor: pointer; white-space: nowrap; flex: none;
  transition: transform .12s, background .15s, color .15s;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--label); color: var(--bg-elev); }
.chip.tinted { background: var(--grad-soft); color: var(--label); }
.chip.static { cursor: default; }
.chip.x-able .x { opacity: .5; margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Cards / list ---------- */
.feed { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--card); border-radius: var(--r-card); padding: 16px 18px;
  box-shadow: var(--shadow-1); cursor: pointer; position: relative; overflow: hidden;
  border: 1px solid var(--hairline);
  transition: transform .16s cubic-bezier(.2,.8,.3,1), box-shadow .2s, border-color .2s;
}
.card:active { transform: scale(.985); }
@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: color-mix(in srgb, var(--tint) 22%, var(--hairline)); }
}
.card .kicker { font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--tint); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.card .kicker .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--label-3); }
.card h3 { font-size: 18px; margin-bottom: 4px; letter-spacing: -0.02em; text-wrap: balance; }
.card .body { font-size: 15px; color: var(--label-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .quote { font-family: var(--serif); font-size: 18.5px; line-height: 1.5; color: var(--label); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--label-3); flex-wrap: wrap; }
.card .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.card.has-stripe { padding-left: 22px; }
.section-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--label-3); padding: 18px 4px 6px; }

/* stats row */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-1); border: 1px solid var(--hairline); }
.stat b { display: block; font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--label-2); font-weight: 600; }
.stat.grad b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* empty state */
.empty { text-align: center; padding: 56px 24px; }
.empty .glyph {
  width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 18px;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px -10px rgba(255,55,95,0.5);
}
.empty .glyph svg { width: 38px; height: 38px; fill: #fff; }
.empty h2 { font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; text-wrap: balance; }
.empty p { color: var(--label-2); font-size: 15.5px; line-height: 1.6; max-width: 46ch; margin: 0 auto 22px; }

/* ---------- Sheets (full-screen editors) ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.32);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0 } }
.sheet {
  background: var(--bg); width: 100%; max-width: 720px; max-height: 94vh;
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column; overflow: hidden;
  animation: slideup .34s cubic-bezier(.2,.9,.25,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
}
@keyframes slideup { from { transform: translateY(100%) } }
@media (min-width: 720px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 20px; max-height: 88vh; }
}
.navbar {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 0.5px solid var(--separator); flex: none;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.navbar .title { flex: 1; text-align: center; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.navbar .btn.plain { font-weight: 600; }
.navbar .btn.plain.strong { font-weight: 700; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 18px 40px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--label-3); margin-bottom: 7px; }
.input {
  width: 100%; border: 0; border-radius: var(--r-field); background: var(--card);
  padding: 13px 15px; font-size: 17px; outline: none; box-shadow: var(--shadow-1);
  transition: box-shadow .15s;
}
.input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 26%, transparent), var(--shadow-1); }
textarea.input { resize: vertical; line-height: 1.55; min-height: 120px; }
textarea.serif-input { font-family: var(--serif); font-size: 18px; line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.helper { font-size: 13px; color: var(--label-2); margin-top: 8px; min-height: 18px; }

/* word meter */
.meter { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--label-2); font-weight: 600; }
.meter .track { flex: 1; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.meter .track i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--grad); transition: width .2s; }
.meter.good .num { color: var(--green); }
.meter.over .num { color: var(--orange); }

/* moods */
.moods { display: flex; gap: 8px; }
.mood {
  width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--fill); cursor: pointer;
  font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center;
  filter: grayscale(1); opacity: .55; transition: transform .16s cubic-bezier(.2,.9,.3,1.3), filter .15s, opacity .15s;
}
.mood:active { transform: scale(.9); }
.mood.on { filter: none; opacity: 1; transform: scale(1.06); background: var(--grad-soft); }

/* goals */
.goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.goals li { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow-1); }
.goals li input[type=text] { flex: 1; border: 0; background: transparent; outline: none; font-size: 16px; }
.goals li.done input[type=text] { color: var(--label-3); text-decoration: line-through; }
.tick {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--label-3); background: transparent;
  cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; padding: 0;
  transition: background .15s, border-color .15s, transform .12s;
}
.tick:active { transform: scale(.88); }
.tick.on { background: var(--green); border-color: var(--green); }
.tick svg { width: 13px; height: 13px; fill: #fff; opacity: 0; transition: opacity .12s; }
.tick.on svg { opacity: 1; }
.goals li .rm { border: 0; background: transparent; color: var(--label-3); cursor: pointer; font-size: 18px; padding: 0 2px; }
.goals li .rm:hover { color: var(--red); }
.row-add { display: flex; gap: 8px; margin-top: 10px; }
.open-goals { background: var(--card); border-radius: 16px; padding: 6px 4px; box-shadow: var(--shadow-1); margin-bottom: 16px; }
.open-goals .head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--label-3); padding: 8px 14px 6px; }
.open-goals li { background: transparent; box-shadow: none; padding: 8px 14px; border-radius: 0; }
.open-goals li + li { border-top: 0.5px solid var(--separator); }
.open-goals li span { font-size: 15px; flex: 1; cursor: pointer; }
.open-goals li small { color: var(--label-3); font-size: 12px; margin-left: 8px; }

/* prompt card */
.prompt {
  background: var(--grad-soft); border-radius: 16px; padding: 14px 16px; margin-bottom: 18px;
  display: flex; gap: 12px; align-items: center;
}
.prompt p { margin: 0; flex: 1; font-family: var(--serif); font-size: 16.5px; font-style: italic; line-height: 1.5; }

/* detail view */
.detail-quote {
  font-family: var(--serif); font-size: 23px; line-height: 1.52; margin: 0 0 18px;
  padding-left: 16px; border-left: 3px solid; border-image: var(--grad) 1; white-space: pre-wrap;
}
.detail-body { font-size: 17px; line-height: 1.65; white-space: pre-wrap; }
.detail-meta { font-size: 14px; color: var(--label-2); margin-bottom: 16px; }
.hr { height: 0.5px; background: var(--separator); border: 0; margin: 20px 0; }

/* ---------- Library ---------- */
.dropzone {
  border: 2px dashed var(--label-3); border-radius: var(--r-card); padding: 26px 20px; text-align: center;
  color: var(--label-2); margin-bottom: 22px; cursor: pointer; background: var(--card-2);
  transition: border-color .18s, background .18s, transform .12s;
}
.dropzone:active { transform: scale(.99); }
.dropzone.over { border-color: var(--tint); background: var(--grad-soft); }
.dropzone b { color: var(--label); display: block; font-size: 17px; margin-bottom: 4px; }
.dropzone .fmts { font-size: 13px; color: var(--label-3); margin-top: 6px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 16px; }
.book { cursor: pointer; position: relative; transition: transform .18s cubic-bezier(.2,.8,.3,1); }
.book:active { transform: scale(.96); }
.book .cover {
  aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; position: relative;
  background: var(--grad); box-shadow: var(--shadow-2); display: flex; align-items: center; justify-content: center;
}
.book .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book .cover .ph { color: #fff; font-family: var(--serif); font-size: 16px; text-align: center; padding: 14px; line-height: 1.3; }
.book .cover .fmt {
  position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  background: rgba(0,0,0,0.55); color: #fff; padding: 3px 7px; border-radius: 6px; backdrop-filter: blur(6px);
}
.book .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.35); }
.book .bar i { display: block; height: 100%; background: #fff; }
.book .t { font-size: 14px; font-weight: 600; margin-top: 9px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book .a { font-size: 12.5px; color: var(--label-2); margin-top: 2px; }
.book .del {
  position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,0.5); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px);
}
.book:hover .del, .book:focus-within .del { opacity: 1; }

/* ============================================================
   READER
   ============================================================ */
.reader { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); z-index: 30; }
.reader-bar {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px; flex: none;
  background: color-mix(in srgb, var(--bg-elev) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator); padding-top: max(8px, env(safe-area-inset-top));
}
.reader-bar .name { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.reader-bar .grow { flex: 1; }
.reader-bar .pill { display: flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.reader-bar .pill input { width: 46px; border: 0; background: var(--card); border-radius: 999px; padding: 3px 6px; text-align: center; font-size: 13px; outline: none; }
.reader-body { flex: 1; display: flex; min-height: 0; position: relative; }
.reader-main { flex: 1; min-width: 0; position: relative; display: flex; overflow: hidden; }

/* PDF — faithful page rendering */
.pdf-scroller {
  flex: 1; overflow: auto; -webkit-overflow-scrolling: touch;
  background: #b9b9be; padding: 16px 0 60px;
}
html[data-theme="dark"] .pdf-scroller { background: #0d0d0f; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; position: relative; }
.pdf-page {
  position: relative; background: #fff; --scale-factor: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25), 0 10px 28px -14px rgba(0,0,0,0.5);
  border-radius: 2px; overflow: hidden; contain: paint;
}
.pdf-page canvas { display: block; image-rendering: auto; }
.pdf-page .plabel {
  position: absolute; right: 8px; bottom: 8px; font-size: 11px; font-weight: 600; color: #fff;
  background: rgba(0,0,0,0.42); padding: 2px 8px; border-radius: 999px; pointer-events: none;
  opacity: 0; transition: opacity .25s; backdrop-filter: blur(4px);
}
.pdf-scroller.scrolling .plabel { opacity: 1; }
/* pdf.js text layer (selection only — never paints) */
.textLayer { position: absolute; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-align: initial; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; z-index: 2; caret-color: CanvasText; }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer br { user-select: none; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: -1; cursor: default; user-select: none; }
.textLayer.selecting .endOfContent { top: 0; }
.textLayer ::selection { background: rgba(0,122,255,0.3); }
/* No z-index here on purpose. A positioned element with one becomes a stacking context, and a
   child's mix-blend-mode can only blend against its own stacking context — so the highlights
   below were multiplying against this layer's transparent backdrop and coming out as flat,
   opaque paint over the words. DOM order already puts this last, which is all it needed. */
.annotLayer { position: absolute; inset: 0; pointer-events: none; }
.annotLayer.placing { pointer-events: auto; cursor: crosshair; }
.hl { position: absolute; mix-blend-mode: multiply; border-radius: 2px; pointer-events: none; }
.hl.has-note { box-shadow: inset 0 -2px 0 rgba(0,0,0,0.28); }

/* EPUB */
.epub-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg); position: relative; }
.epub-view { flex: 1; min-height: 0; margin: 12px 44px; position: relative; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-1); }
.epub-view > .epub-container { position: absolute !important; inset: 0; }
.epub-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 72px; border: 0;
  background: transparent; color: var(--label-3); cursor: pointer; border-radius: 12px; z-index: 6;
  display: flex; align-items: center; justify-content: center;
}
.epub-nav:hover { background: var(--fill); color: var(--label); }
.epub-nav svg { width: 20px; height: 20px; fill: currentColor; }
.epub-nav.prev { left: 4px; } .epub-nav.next { right: 4px; }
.epub-foot { text-align: center; font-size: 12px; color: var(--label-3); padding: 2px 0 8px; font-weight: 600; }

/* ---------- Sticky notes: tiny square that expands ---------- */
.sticky-layer { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.sticky-layer.placing { pointer-events: auto; cursor: crosshair; }
/* A bookmark shows itself in the margin, beside the line rather than over it — a tab sticking out
   of the page, the way a real one would. Sticky pins used to live on this layer and sat on top of
   the words they were about. */
.bm-flag {
  position: absolute; right: 8px; margin-top: -14px; pointer-events: auto;
  width: 28px; height: 28px; padding: 0; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 5;
  color: var(--tint); background: var(--bg-elev); border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(0,0,0,0.06);
  transition: transform .16s cubic-bezier(.2,.9,.3,1.4);
}
.bm-flag svg { width: 17px; height: 17px; fill: currentColor; }
.bm-flag:hover { transform: scale(1.12); }
.bm-flag:active { transform: scale(.92); }
@media (max-width: 560px) { .bm-flag { right: 2px; width: 26px; height: 30px; } }
.note-card {
  position: absolute; pointer-events: auto; width: 216px; z-index: 9;
  background: var(--pin, #fff7b0); color: #1b1b1f; border-radius: 10px;
  box-shadow: 0 8px 26px -8px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.25);
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: var(--ox, 0) var(--oy, 0);
  animation: pop .18s cubic-bezier(.2,.9,.3,1.25);
}
@keyframes pop { from { transform: scale(.5); opacity: 0 } }
.note-card .bar { display: flex; align-items: center; gap: 2px; padding: 5px 6px; cursor: move; background: rgba(0,0,0,0.06); }
.note-card .swatches { display: flex; gap: 4px; flex: 1; padding-left: 2px; }
.note-card .swatches i { width: 13px; height: 13px; border-radius: 50%; cursor: pointer; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }
.note-card .swatches i.on { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), 0 0 0 2px rgba(0,0,0,0.55); }
.note-card .bar button { width: 22px; height: 22px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; color: #1b1b1f; display: flex; align-items: center; justify-content: center; padding: 0; }
.note-card .bar button:hover { background: rgba(0,0,0,0.12); }
.note-card .bar button svg { width: 11px; height: 11px; fill: currentColor; }
.note-card textarea {
  border: 0; background: transparent; padding: 9px 10px; min-height: 76px; max-height: 210px; resize: none;
  outline: none; font-family: var(--sans); font-size: 14px; line-height: 1.45; color: #1b1b1f;
}
.note-card textarea::placeholder { color: rgba(0,0,0,0.38); }
.note-card .meta { padding: 0 10px 7px; font-size: 10.5px; color: rgba(0,0,0,0.5); display: flex; justify-content: space-between; font-weight: 600; }

/* ---------- Selection toolbar ---------- */
.sel-pop {
  position: fixed; z-index: 70; border-radius: 14px; padding: 5px;
  background: color-mix(in srgb, #1c1c1e 92%, transparent); color: #fff;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 34px -8px rgba(0,0,0,0.55);
  display: flex; align-items: center; gap: 2px;
  animation: pop .16s cubic-bezier(.2,.9,.3,1.2);
}
html[data-theme="dark"] .sel-pop { background: color-mix(in srgb, #f2f2f7 94%, transparent); color: #000; }
/* On a phone the browser puts its own Copy / Look Up bar exactly where ours wants to sit, on top
   of it. There is no way to suppress that menu without breaking text selection itself, so ours
   moves out from under it and docks to the bottom, which is easier to reach with a thumb anyway.
   --sel-dock-b is set from the visual viewport, so it clears Safari's bottom chrome too. */
.sel-pop.docked {
  left: 50%; right: auto; top: auto;
  transform: translateX(-50%);
  bottom: calc(var(--sel-dock-b, 0px) + 16px + var(--safe-b));
  max-width: calc(100vw - 20px);
  animation: sel-rise .18s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes sel-rise { from { transform: translateX(-50%) translateY(10px); opacity: 0 } }
.sel-pop button {
  border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: 10px;
  padding: 7px 9px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; min-width: 54px;
}
.sel-pop button svg { width: 17px; height: 17px; fill: currentColor; }
.sel-pop button:hover { background: rgba(255,255,255,0.16); }
html[data-theme="dark"] .sel-pop button:hover { background: rgba(0,0,0,0.1); }
.sel-pop .inks { display: flex; gap: 5px; padding: 0 7px; }
.sel-pop .inks i { width: 18px; height: 18px; border-radius: 50%; cursor: pointer; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }
.sel-pop .inks i.on { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), 0 0 0 2px currentColor; }
.sel-pop .div { width: 1px; align-self: stretch; margin: 4px 2px; background: currentColor; opacity: .2; }

/* highlight editor popover */
.hl-pop {
  position: fixed; z-index: 65; width: 290px; background: var(--bg-elev); border-radius: 16px;
  box-shadow: var(--shadow-2); padding: 12px 13px; animation: pop .16s cubic-bezier(.2,.9,.3,1.2);
  border: 0.5px solid var(--separator);
}
.hl-pop .q { font-family: var(--serif); font-size: 15px; line-height: 1.45; color: var(--label-2); max-height: 88px; overflow: auto; padding-left: 10px; border-left: 3px solid var(--hl-yellow); margin-bottom: 10px; }
.hl-pop textarea { width: 100%; min-height: 66px; border: 0; border-radius: 10px; background: var(--fill); padding: 9px 10px; resize: vertical; outline: none; font-size: 15px; }
.hl-pop .row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.hl-pop .inks { display: flex; gap: 6px; flex: 1; }
.hl-pop .inks i { width: 18px; height: 18px; border-radius: 50%; cursor: pointer; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.hl-pop .inks i.on { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15), 0 0 0 2px var(--label); }

/* ---------- Reader sidebar ---------- */
.side {
  width: 330px; flex: none; border-left: 0.5px solid var(--separator); background: var(--bg-elev);
  display: flex; flex-direction: column; min-height: 0;
}
.side.collapsed { display: none; }
@media (max-width: 860px) {
  .side { position: absolute; right: 0; top: 0; bottom: 0; width: min(88%, 340px); z-index: 20; box-shadow: var(--shadow-2); }
}
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; margin: 10px; flex: none; }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 6px 4px; font-size: 13px;
  font-weight: 600; cursor: pointer; color: var(--label-2); transition: background .18s, color .18s;
}
.seg button.on { background: var(--bg-elev); color: var(--label); box-shadow: var(--shadow-1); }
.side-body { flex: 1; overflow-y: auto; padding: 4px 12px 20px; }
.toc a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--label); font-size: 15px; }
.toc a:hover { background: var(--fill); }
.toc a.lvl1 { padding-left: 24px; font-size: 14px; color: var(--label-2); }
.toc a.lvl2 { padding-left: 38px; font-size: 13.5px; color: var(--label-2); }
.note-row { background: var(--card); border-radius: 14px; padding: 11px 13px; margin-bottom: 9px; cursor: pointer; box-shadow: var(--shadow-1); }
.note-row .q { font-family: var(--serif); font-size: 14.5px; line-height: 1.4; padding-left: 9px; border-left: 3px solid var(--hl-yellow); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-row .c { font-size: 14px; margin-top: 7px; color: var(--label); white-space: pre-wrap; }
.note-row .m { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11.5px; color: var(--label-3); font-weight: 600; }
.note-row .m button { border: 0; background: transparent; color: var(--label-3); cursor: pointer; font-size: 11.5px; font-weight: 600; padding: 0; }
.note-row .m button:hover { color: var(--red); }
.list-empty { text-align: center; color: var(--label-3); font-size: 14px; padding: 32px 16px; }

/* ---------- Menus, modals, toast ---------- */
.menu {
  position: fixed; z-index: 90; background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-radius: 14px; box-shadow: var(--shadow-2); padding: 5px; min-width: 230px;
  border: 0.5px solid var(--separator); animation: pop .15s cubic-bezier(.2,.9,.3,1.2);
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0;
  background: transparent; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--label); font-size: 15px;
}
.menu button:hover { background: var(--fill); }
.menu button.danger { color: var(--red); }
.menu .sep { height: 0.5px; background: var(--separator); margin: 4px 8px; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 95; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s; }
.modal { background: var(--bg-elev); border-radius: 20px; padding: 22px; width: min(400px, 100%); box-shadow: var(--shadow-2); animation: pop .22s cubic-bezier(.2,.9,.3,1.15); text-align: center; }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--label-2); margin: 0 0 16px; }
.modal .input { margin-bottom: 14px; text-align: left; }
.modal .acts { display: flex; gap: 10px; }
.modal .acts .btn { flex: 1; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 26px); z-index: 100;
  background: color-mix(in srgb, #1c1c1e 92%, transparent); color: #fff;
  padding: 11px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow-2); backdrop-filter: blur(20px); max-width: 90vw; text-align: center;
  animation: toastin .28s cubic-bezier(.2,.9,.3,1.2);
}
html[data-theme="dark"] .toast { background: color-mix(in srgb, #f2f2f7 94%, transparent); color: #000; }
@keyframes toastin { from { transform: translate(-50%, 16px); opacity: 0 } }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--fill); border-top-color: var(--tint); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.loading {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; background: var(--bg); color: var(--label-2); font-size: 15px; font-weight: 600;
}
kbd { font-family: var(--mono); font-size: 11px; background: var(--fill); border-radius: 5px; padding: 2px 5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* two-page spread gutter */
.epub-view.spread::before {
  content: ""; position: absolute; top: 12px; bottom: 12px; left: 50%; width: 1px;
  background: var(--separator); z-index: 1; pointer-events: none;
}

/* Selection toolbar collapses to icons on narrow screens */
@media (max-width: 560px) {
  .sel-pop { padding: 4px; gap: 0; }
  .sel-pop .div { margin: 4px 1px; }
  .sel-pop button { min-width: 0; padding: 8px 7px; gap: 0; }
  .sel-pop button span { display: none; }
  .sel-pop button svg { width: 19px; height: 19px; }
  .sel-pop .inks { padding: 0 5px; gap: 5px; }
  .sel-pop .inks i { width: 17px; height: 17px; }
  .hl-pop { width: min(290px, calc(100vw - 24px)); }
  .note-card { width: 200px; }
}

/* ============================================================
   Masthead — the app's own name, above each section title
   ============================================================ */
.masthead { display: flex; align-items: center; gap: 9px; padding: 18px 0 2px; }
.masthead .mark {
  width: 27px; height: 27px; border-radius: 9px; background-image: var(--grad);
  display: flex; align-items: center; justify-content: center; flex: none;
  box-shadow: 0 4px 12px -4px rgba(255,55,95,0.45);
}
.masthead .mark svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.masthead .mark svg .blade { fill: #fff; stroke: none; }
.masthead .word { font-size: 14.5px; font-weight: 700; letter-spacing: 0.01em; }
.masthead .word em { font-style: normal; color: var(--label-3); font-weight: 600; }
.masthead .spacer { flex: 1; }

/* section intro line under the big title */
.subtitle { max-width: 54ch; }

/* ============================================================
   Reading list
   ============================================================ */
.read-card { cursor: default; padding: 15px 17px; }
.read-card.done { opacity: .62; }
.read-card.done:hover { opacity: 1; }
.read-head { display: flex; align-items: flex-start; gap: 12px; }
.site {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; font-family: var(--display); color: #fff;
  background-image: linear-gradient(140deg, hsl(var(--h) 72% 62%), hsl(calc(var(--h) + 28) 66% 50%));
  box-shadow: 0 3px 10px -4px hsl(var(--h) 60% 45% / .6);
}
.read-title {
  display: block; font-family: var(--display); font-size: 19px; font-weight: 600;
  line-height: 1.25; letter-spacing: -0.01em; color: var(--label); text-decoration: none;
  text-wrap: balance;
}
.read-title:hover { color: var(--tint); text-decoration: underline; text-underline-offset: 3px; }
.read-card.done .read-title { text-decoration: line-through; text-decoration-color: var(--label-3); }
.read-sub { font-size: 13px; color: var(--label-2); margin-top: 3px; font-weight: 500; }
.read-note { margin: 11px 0 0; font-size: 15px; line-height: 1.5; color: var(--label-2); }
.read-card .foot { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--hairline); }
.link-btn { border: 0; background: transparent; color: var(--tint); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0 0 0 12px; }
.link-btn:hover { text-decoration: underline; }
.read-head .tick { margin-top: 6px; }

/* ============================================================
   Journal week strip
   ============================================================ */
.weekstrip {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 18px;
  padding: 13px 12px 15px; box-shadow: var(--shadow-1); margin-bottom: 16px;
}
.wk-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 11px; }
.wk-title { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--label-3); }
.wk-count { font-size: 12.5px; font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.wk-row { display: flex; gap: 2px; }

/* a day: no chrome of its own, just type and a mark */
.wk-day {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  cursor: pointer; font: inherit; color: inherit; -webkit-appearance: none; appearance: none;
}
.wk-dow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--label-3); transition: color .18s;
}
.wk-slot { position: relative; width: 100%; display: flex; justify-content: center; }
.wk-num {
  position: relative; z-index: 1;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: transform .18s cubic-bezier(.2,.9,.3,1.4), box-shadow .18s, background-color .18s;
}
/* days you wrote */
.wk-day.has .wk-num {
  background-image: var(--grad); color: #fff;
  box-shadow: 0 4px 11px -3px rgba(255,55,95,.55);
}
.wk-day.has .wk-dow { color: var(--label-2); }
/* days you did not */
.wk-day.empty .wk-num {
  color: var(--label-3);
  box-shadow: inset 0 0 0 1.5px var(--separator);
}
/* today */
.wk-day.today .wk-num { outline: 2px solid var(--tint); outline-offset: 2.5px; }
.wk-day.today.empty .wk-num { color: var(--tint); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tint) 45%, transparent); }
/* consecutive days join into a streak ribbon */
.wk-day.linked .wk-slot::before {
  content: ""; position: absolute; top: 50%; margin-top: -1.5px;
  right: 50%; left: calc(-50% - 1px); height: 3px; border-radius: 2px;
  background-image: var(--grad); opacity: .3; z-index: 0;
}
/* the indicator under every day: solid when written, faint when not */
.wk-mark {
  height: 15px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1;
}
.wk-day.has .wk-mark::after, .wk-day.empty .wk-mark::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
}
.wk-day.has .wk-mark:not(:empty)::after { display: none; }
.wk-day.has .wk-mark::after { background-image: var(--grad); }
.wk-day.empty .wk-mark::after { background: var(--label-3); opacity: .3; }
@media (hover: hover) {
  .wk-day:hover .wk-num { transform: translateY(-2px); }
  .wk-day.empty:hover .wk-num { box-shadow: inset 0 0 0 1.5px var(--label-3); color: var(--label-2); }
  .wk-day:hover .wk-dow { color: var(--label-2); }
}
.wk-day:active .wk-num { transform: scale(.9); }
.wk-day:focus-visible { outline: none; }
.wk-day:focus-visible .wk-num { outline: 2px solid var(--tint); outline-offset: 2.5px; }

/* ============================================================
   Continue reading (library)
   ============================================================ */
.resume {
  display: flex; align-items: center; gap: 15px; background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-card); padding: 14px 16px; box-shadow: var(--shadow-1); margin-bottom: 22px;
  cursor: pointer; transition: transform .16s, box-shadow .2s;
}
.resume:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.resume .thumb { width: 46px; height: 66px; border-radius: 7px; overflow: hidden; flex: none; background-image: var(--grad); box-shadow: var(--shadow-1); }
.resume .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.resume .meta { flex: 1; min-width: 0; }
.resume .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--tint); }
.resume h3 { font-family: var(--display); font-size: 19px; font-weight: 600; margin: 3px 0 5px; letter-spacing: -0.01em; }
.resume .line { height: 5px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.resume .line i { display: block; height: 100%; background-image: var(--grad); border-radius: 3px; }
.resume .pct { font-size: 12.5px; color: var(--label-2); margin-top: 5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   Richer empty states
   ============================================================ */
.empty .glyph { width: 82px; height: 82px; border-radius: 24px; }
.empty .glyph svg { width: 40px; height: 40px; }
.empty .points { display: flex; flex-direction: column; gap: 12px; max-width: 42ch; margin: 4px auto 24px; text-align: left; }
.empty .point { display: flex; gap: 11px; align-items: flex-start; }
.empty .point .n {
  width: 23px; height: 23px; border-radius: 8px; flex: none; background: var(--grad-soft);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--tint);
}
.empty .point p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--label-2); max-width: none; text-align: left; }
.empty .point b { color: var(--label); font-weight: 600; }

/* card badge for an unfinished close reading */
.badge-soft {
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent);
  padding: 3px 8px; border-radius: 999px;
}

/* sort control */
.toolrow { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolrow .spacer { flex: 1; }
.select-plain {
  border: 0; background: var(--fill); border-radius: 999px; padding: 7px 12px;
  font-size: 13.5px; font-weight: 600; color: var(--label-2); cursor: pointer;
}

/* ============================================================
   Tab bar: tucks away while you read
   ============================================================ */
.tabbar {
  transition: transform .34s cubic-bezier(.2,.85,.3,1), opacity .22s ease;
  will-change: transform;
}
.tabbar.tucked {
  transform: translateY(calc(100% + 12px));
  opacity: 0;
  pointer-events: none;
}
@media (min-width: 860px) {
  .tabbar.tucked { transform: translateX(-50%) translateY(calc(100% + 24px)); }
}

/* the handle left behind, so the bar is never lost */
.tab-hint {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: var(--safe-b); width: 96px; height: 24px; z-index: 49;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; cursor: pointer; border: 0; background: transparent;
  transition: opacity .3s ease;
}
.tab-hint::before {
  content: ""; width: 44px; height: 4px; border-radius: 999px;
  background: var(--label-3); transition: width .2s ease, background .2s ease;
}
.tabbar.tucked ~ .tab-hint { opacity: .75; pointer-events: auto; }
.tab-hint:hover::before, .tab-hint:focus-visible::before { width: 58px; background: var(--tint); }
.tab-hint:focus-visible { outline: none; }
.tabbar[hidden] ~ .tab-hint { display: none; }
@media (min-width: 860px) {
  .tab-hint { bottom: 8px; }
}

/* ============================================================
   Welcome / sign-up page
   ============================================================ */
.welcome { max-width: 940px; margin: 0 auto; padding: 0 20px 60px; }

.hero { text-align: center; padding: clamp(38px, 9vw, 84px) 0 clamp(30px, 6vw, 56px); }
.hero-mark {
  width: 68px; height: 68px; border-radius: 21px; margin: 0 auto 26px;
  background-image: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 34px -10px rgba(255,55,95,.55);
}
.hero-mark svg { width: 36px; height: 36px; }
.hero h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(38px, 7.4vw, 62px); line-height: 1.04; letter-spacing: -0.03em;
  margin-bottom: 20px; text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  font-size: clamp(16px, 2.1vw, 19px); line-height: 1.6; color: var(--label-2);
  max-width: 56ch; margin: 0 auto 30px; text-wrap: pretty;
}
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.btn.big { font-size: 16.5px; padding: 15px 28px; border-radius: 16px; box-shadow: 0 10px 26px -8px rgba(255,55,95,.5); }
.btn.wide { width: 100%; padding: 13px 18px; margin-bottom: 10px; }
.hero-note {
  margin: 0; font-size: 14px; color: var(--label-2); max-width: 46ch;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; text-align: center;
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.hero-alt { margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.hero-sep { color: var(--label-3); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: clamp(40px, 8vw, 72px); }
.feature {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: 22px 20px; box-shadow: var(--shadow-1);
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .2s;
}
@media (hover: hover) { .feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); } }
.feature-icon {
  width: 40px; height: 40px; border-radius: 13px; margin-bottom: 14px;
  background: var(--grad-soft); color: var(--tint);
  display: flex; align-items: center; justify-content: center;
}
.feature-icon svg { width: 21px; height: 21px; fill: currentColor; }
.feature h3 { font-family: var(--display); font-size: 20px; font-weight: 600; margin-bottom: 7px; }
.feature p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--label-2); }

.steps { margin-bottom: clamp(40px, 8vw, 72px); }
.steps h2, .promise h2 {
  font-family: var(--display); font-weight: 600; font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -0.02em; text-align: center; margin-bottom: 26px; text-wrap: balance;
}
.step-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.step-list li { display: flex; gap: 14px; align-items: flex-start; }
.step-n {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background-image: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; box-shadow: 0 5px 13px -4px rgba(255,55,95,.5);
}
.step-list b { display: block; font-size: 16px; margin-bottom: 4px; }
.step-list p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--label-2); }

.promise {
  text-align: center; background: var(--card); border: 1px solid var(--hairline);
  border-radius: 26px; padding: clamp(28px, 5vw, 44px) 24px; box-shadow: var(--shadow-1);
}
.promise p { max-width: 54ch; margin: 0 auto 24px; font-size: 15.5px; line-height: 1.6; color: var(--label-2); }
.promise .hero-note { margin-top: 14px; }

.welcome-foot {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; color: var(--label-3); font-weight: 600;
}

/* ---------- auth sheet ---------- */
.auth-lead { text-align: center; margin-bottom: 22px; }
.auth-lead h2 { font-family: var(--display); font-size: 25px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.auth-lead p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--label-2); max-width: 40ch; margin-inline: auto; }
.auth-fine { font-size: 13px; color: var(--label-3); text-align: center; line-height: 1.5; margin: 14px auto 0; max-width: 42ch; }
.form-error {
  background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red);
  border-radius: 12px; padding: 10px 13px; font-size: 14px; font-weight: 500; margin-bottom: 14px;
}
.switch-row {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 13px 15px; margin-bottom: 16px; cursor: pointer; box-shadow: var(--shadow-1);
}
.switch-row span { flex: 1; }
.switch-row b { display: block; font-size: 15px; font-weight: 600; }
.switch-row small { display: block; font-size: 13px; color: var(--label-2); margin-top: 2px; }
.switch-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--tint); flex: none; }
.code-input {
  text-align: center; font-size: 30px; font-weight: 600; letter-spacing: .34em;
  padding: 16px 10px 16px 24px; font-variant-numeric: tabular-nums; font-family: var(--sans);
}
.spinner.on-dark { border-color: rgba(255,255,255,.35); border-top-color: #fff; width: 15px; height: 15px; }

/* a book whose record has synced but whose file is still downloading */
.book.waiting { cursor: progress; }
.book.waiting .cover { opacity: .55; }
.waiting-veil {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  backdrop-filter: blur(2px);
}

/* ============================================================
   Revisit
   ============================================================ */
.revisit {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: 18px 20px 16px; box-shadow: var(--shadow-1); margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.revisit::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background-image: var(--grad);
}
.revisit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.revisit-head svg { width: 15px; height: 15px; fill: var(--tint); flex: none; }
.revisit-label { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--tint); }
.revisit-when { font-size: 12.5px; color: var(--label-3); margin-left: auto; }
.revisit-quote {
  font-family: var(--serif); font-size: 19px; line-height: 1.5; margin: 0 0 10px;
  cursor: pointer; text-wrap: pretty;
}
.revisit-source { font-size: 13px; color: var(--label-2); margin-bottom: 12px; }
.revisit-reading { margin-bottom: 13px; }
.revisit-reading summary { font-size: 13.5px; font-weight: 600; color: var(--tint); cursor: pointer; }
.revisit-reading summary::marker { color: var(--label-3); }
.revisit-reading p { margin: 9px 0 0; font-size: 15px; line-height: 1.6; color: var(--label-2); }
.revisit-nudge { font-size: 13.5px; color: var(--orange); margin-bottom: 13px; font-weight: 500; }
.revisit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.plain.sm { padding: 7px 10px; }

/* ============================================================
   Kindle import
   ============================================================ */
.kindle-steps { margin: 0 0 20px; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; color: var(--label-2); font-size: 15px; }
.kindle-steps b { color: var(--label); font-weight: 600; }
.kindle-steps code { background: var(--fill); padding: 1.5px 6px; border-radius: 5px; font-size: 13px; color: var(--label); }
.kindle-note { font-size: 14px; color: var(--label-2); margin: 0 0 12px; }
.kindle-books {
  display: flex; flex-direction: column; max-height: 44vh; overflow-y: auto;
  border: 1px solid var(--hairline); border-radius: 14px; background: var(--card); margin-bottom: 14px;
}
.kindle-book { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; }
.kindle-book + .kindle-book { border-top: 1px solid var(--hairline); }
.kindle-book.done { opacity: .5; cursor: default; }
.kindle-book input { width: 19px; height: 19px; accent-color: var(--tint); flex: none; margin-top: 2px; }
.kindle-book b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.kindle-book small { display: block; font-size: 13px; color: var(--label-2); margin-top: 2px; }
.kindle-book .kindle-count { color: var(--tint); font-weight: 600; font-size: 12.5px; }
.kindle-summary { font-size: 13.5px; color: var(--label-3); text-align: center; margin: 0 0 10px; font-weight: 600; }

/* ============================================================
   Landing page top bar
   ============================================================ */
.topnav {
  position: sticky; top: 0; z-index: 45;
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 4vw, 34px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.topnav-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--label); }
.topnav-mark {
  width: 30px; height: 30px; border-radius: 10px; background-image: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
  box-shadow: 0 4px 12px -4px rgba(255,55,95,.45);
}
.topnav-mark svg { width: 17px; height: 17px; }
.topnav-word { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.topnav-word em { font-style: normal; color: var(--label-3); font-weight: 600; }
.topnav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topnav-cta {
  border: 0; cursor: pointer; text-decoration: none;
  background: var(--bg-elev); color: var(--label);
  font-size: 15px; font-weight: 600; padding: 11px 21px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-1);
  transition: transform .14s cubic-bezier(.2,.8,.3,1), box-shadow .18s;
}
.topnav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.topnav-cta:active { transform: scale(.97); }
.topnav-cta .arrow { transition: transform .18s; }
.topnav-cta:hover .arrow { transform: translateX(3px); }
.welcome { padding-top: 6px; }

/* ============================================================
   Blindspots
   ============================================================ */
.bs-section { margin-bottom: 26px; }
.bs-section h3 { font-family: var(--display); font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.bs-lead { font-size: 14.5px; line-height: 1.55; color: var(--label-2); margin: 0 0 12px; }
.bs-bars { display: flex; flex-direction: column; gap: 8px; }
.bs-bar { display: grid; grid-template-columns: minmax(96px, 34%) 1fr auto; align-items: center; gap: 11px; }
.bs-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-track { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bs-track i { display: block; height: 100%; border-radius: 4px; background-image: var(--grad); }
.bs-n { font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: right; }
.bs-practise {
  background: var(--grad-soft); border-radius: 18px; padding: 18px 20px; margin-bottom: 18px;
}
.bs-practise-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.bs-practise-head svg { width: 15px; height: 15px; fill: var(--tint); }
.bs-practise-head span { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--tint); }
.bs-device { margin: 0 0 4px; font-size: 16px; }
.bs-device b { font-weight: 600; }
.bs-def { margin: 0 0 14px; font-size: 14px; color: var(--label-2); font-style: italic; }
.bs-quote { font-family: var(--serif); font-size: 18px; line-height: 1.5; margin: 0 0 8px; }
.bs-source { font-size: 13px; color: var(--label-2); margin-bottom: 16px; }

/* ============================================================
   Second reading
   ============================================================ */
.rr-passage {
  font-family: var(--serif); font-size: 20px; line-height: 1.5; margin: 0 0 8px;
  padding-left: 15px; border-left: 3px solid; border-image: var(--grad) 1; white-space: pre-wrap;
}
.rr-source { font-size: 13px; color: var(--label-2); margin-bottom: 20px; }
.rr-columns { display: grid; gap: 14px; margin: 20px 0; }
@media (min-width: 620px) { .rr-columns { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.rr-col { background: var(--card); border: 1px solid var(--hairline); border-radius: 16px; padding: 16px 17px; box-shadow: var(--shadow-1); }
.rr-col.latest { border-color: color-mix(in srgb, var(--tint) 34%, var(--hairline)); }
.rr-when { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--label-3); margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.rr-badge { background: var(--grad-soft); color: var(--tint); padding: 2px 7px; border-radius: 999px; letter-spacing: .03em; }
.rr-col p { margin: 0; font-size: 15px; line-height: 1.62; }
.rr-count { margin-top: 10px; font-size: 12.5px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.reading-date { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--label-3); margin-left: 9px; }

/* ============================================================
   Sign-up affordance inside the app
   ============================================================ */
.masthead-cta {
  border: 0; cursor: pointer; background-image: var(--grad); color: #fff;
  font-size: 13.5px; font-weight: 600; padding: 7px 15px; border-radius: 999px;
  box-shadow: 0 4px 12px -4px rgba(255,55,95,.5); flex: none;
  transition: transform .14s cubic-bezier(.2,.8,.3,1);
}
.masthead-cta:active { transform: scale(.95); }

/* ============================================================
   "and many more"
   ============================================================ */
.more-link { text-align: center; margin: -6px 0 clamp(40px, 8vw, 68px); }
.more-link button {
  border: 0; background: transparent; cursor: pointer; color: var(--label-2);
  font-size: 15px; font-family: var(--display); font-style: italic; padding: 8px 14px;
  border-bottom: 1px solid var(--label-3); border-radius: 0;
  transition: color .16s, border-color .16s;
}
.more-link button:hover { color: var(--tint); border-color: var(--tint); }
.all-features { display: flex; flex-direction: column; gap: 26px; }
.all-lead { margin: 0; font-size: 15px; color: var(--label-2); }
.af-group h3 {
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tint); margin-bottom: 12px;
}
.af-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.af-group li { display: flex; flex-direction: column; gap: 3px; }
.af-group b { font-size: 15.5px; font-weight: 600; }
.af-group span { font-size: 14.5px; line-height: 1.55; color: var(--label-2); }

/* ============================================================
   Site footer
   ============================================================ */
.site-foot { margin-top: clamp(46px, 9vw, 84px); border-top: 1px solid var(--hairline); padding-top: 34px; }
.foot-top { display: grid; grid-template-columns: minmax(220px, 1.7fr) repeat(2, minmax(130px, 1fr)); gap: 30px; }
@media (max-width: 640px) { .foot-top { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
.foot-brand { display: flex; gap: 12px; align-items: flex-start; }
.foot-mark {
  width: 32px; height: 32px; border-radius: 11px; background-image: var(--grad); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.foot-mark svg { width: 18px; height: 18px; }
.foot-word { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.foot-word em { font-style: normal; color: var(--label-3); font-weight: 600; }
.foot-brand p { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--label-2); max-width: 34ch; }
.foot-links { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.foot-links h4 {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--label-3); margin: 0 0 2px;
}
.foot-links a, .foot-links button {
  border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left;
  font-size: 14.5px; color: var(--label-2); text-decoration: none; font-family: inherit;
  transition: color .15s;
}
.foot-links a:hover, .foot-links button:hover { color: var(--tint); }
.foot-social { display: inline-flex; align-items: center; gap: 7px; }
.foot-social svg { width: 17px; height: 17px; fill: currentColor; }
.foot-bottom {
  margin-top: 30px; padding: 18px 0 6px; border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--label-3);
}
.foot-note { max-width: 46ch; }

/* ============================================================
   Citations, provenance
   ============================================================ */
.cite-row { margin-bottom: 16px; }
.cite-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cite-label { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--label-3); }
.cite-text {
  display: block; background: var(--card); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 12px 14px; font-family: var(--serif); font-size: 14.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.cite-missing {
  background: color-mix(in srgb, var(--orange) 12%, transparent); color: var(--orange);
  border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; font-weight: 500;
}
.cite-divider { height: 1px; background: var(--hairline); margin: 22px 0 18px; }
.btn.provenance { justify-content: flex-start; gap: 9px; margin-bottom: 12px; }
.btn.provenance svg { width: 17px; height: 17px; fill: var(--tint); flex: none; }

/* ============================================================
   Privacy and terms
   ============================================================ */
.legal { max-width: 680px; margin: 0 auto; padding: 26px 20px 70px; }
.legal-head { padding-bottom: 26px; border-bottom: 1px solid var(--hairline); margin-bottom: 30px; }
.legal-back {
  display: inline-block; font-size: 14px; font-weight: 600; color: var(--label-2);
  text-decoration: none; margin-bottom: 22px;
}
.legal-back:hover { color: var(--tint); }
.legal h1 { font-family: var(--display); font-size: clamp(30px, 5.4vw, 42px); font-weight: 600; letter-spacing: -0.02em; }
.legal-standfirst { font-size: 17px; line-height: 1.55; color: var(--label-2); margin: 12px 0 0; max-width: 52ch; }
.legal-updated { font-size: 13px; color: var(--label-3); margin: 14px 0 0; }
.legal-section { margin-bottom: 30px; }
.legal-section h2 { font-family: var(--display); font-size: 21px; font-weight: 600; margin-bottom: 11px; letter-spacing: -0.01em; }
.legal-section p { margin: 0 0 12px; font-size: 15.5px; line-height: 1.68; color: var(--label-2); max-width: 66ch; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section a { color: var(--tint); }
.legal-list { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.legal-list li { position: relative; padding-left: 20px; font-size: 15.5px; line-height: 1.62; color: var(--label-2); max-width: 66ch; }
.legal-list li::before { content: ""; position: absolute; left: 3px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background-image: var(--grad); }
.legal-list b { color: var(--label); font-weight: 600; }
.legal-foot {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--hairline);
  display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--label-3);
}
.legal-foot a { color: var(--label-2); text-decoration: none; }
.legal-foot a:hover { color: var(--tint); }

/* danger zone in the account sheet */
.danger-zone {
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--hairline);
}
.danger-zone h4 { font-size: 15px; font-weight: 600; margin: 0 0 6px; color: var(--red); }
.danger-zone p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--label-2); }
.btn.danger.wide { background: color-mix(in srgb, var(--red) 12%, transparent); }

/* ============================================================
   Index
   ============================================================ */
.idx-group { margin-bottom: 22px; }
.idx-group h4 {
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--label-3); margin: 0 0 11px;
}
.idx-terms { display: flex; flex-wrap: wrap; gap: 7px; }
.idx-term {
  border: 0; cursor: pointer; background: var(--card); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 6px 8px 6px 13px; font-size: 14px; color: var(--label);
  display: inline-flex; align-items: center; gap: 7px; font-family: inherit;
  transition: border-color .15s, transform .12s;
}
.idx-term:hover { border-color: var(--tint); }
.idx-term:active { transform: scale(.96); }
.idx-term span {
  font-size: 11.5px; font-weight: 700; color: var(--tint); background: var(--grad-soft);
  border-radius: 999px; padding: 2px 7px; font-variant-numeric: tabular-nums;
}
.idx-detail { border-top: 1px solid var(--hairline); padding-top: 20px; margin-top: 6px; }
.idx-detail h3 { font-family: var(--display); font-size: 22px; font-weight: 600; margin-bottom: 14px; }
.idx-count { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--label-3); margin-left: 10px; }
.idx-quote {
  font-family: var(--serif); font-size: 16.5px; line-height: 1.5; margin: 0 0 14px;
  padding-left: 14px; border-left: 3px solid; border-image: var(--grad) 1; cursor: pointer;
}
.idx-quote cite { display: block; font-family: var(--sans); font-size: 12.5px; font-style: normal; color: var(--label-3); margin-top: 7px; }

/* ============================================================
   Unfinished shelf
   ============================================================ */
.unfinished {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: 17px 19px; box-shadow: var(--shadow-1); margin-bottom: 20px;
}
.unf-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.unf-head svg { width: 15px; height: 15px; fill: var(--orange); flex: none; }
.unf-head span { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--orange); }
.unf-more { margin-left: auto; color: var(--label-3) !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 600 !important; font-size: 12.5px !important; }
.unf-body { display: flex; gap: 14px; align-items: flex-start; }
.unf-thumb { width: 44px; height: 63px; border-radius: 7px; overflow: hidden; flex: none; background-image: var(--grad); box-shadow: var(--shadow-1); }
.unf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.unf-meta { flex: 1; min-width: 0; }
.unf-meta h3 { font-family: var(--display); font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.unf-when { margin: 0 0 9px; font-size: 13px; color: var(--label-2); }
.unf-line { height: 5px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.unf-line i { display: block; height: 100%; background-image: var(--grad); border-radius: 3px; }
.unf-last { margin-top: 14px; }
.unf-last-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--label-3); margin-bottom: 6px; }
.unf-last blockquote { margin: 0; font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: var(--label-2); padding-left: 12px; border-left: 2px solid var(--hairline); }
.unf-actions { display: flex; gap: 8px; margin-top: 15px; }

/* ============================================================
   This time last year
   ============================================================ */
.onthisday {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: 16px 18px; box-shadow: var(--shadow-1); margin-bottom: 16px;
}
.otd-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.otd-head svg { width: 15px; height: 15px; fill: var(--purple); flex: none; }
.otd-head span { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--purple); }
.otd-when { margin-left: auto; color: var(--label-3) !important; letter-spacing: 0 !important; text-transform: none !important; font-size: 12.5px !important; }
.otd-item { cursor: pointer; padding: 11px 0; border-top: 1px solid var(--hairline); }
.otd-item:first-of-type { border-top: 0; padding-top: 0; }
.otd-kind { font-size: 12px; font-weight: 600; color: var(--label-3); margin-bottom: 5px; }
.otd-item p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--label-2); }
.otd-item blockquote { margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.5; }
.otd-item:hover blockquote, .otd-item:hover p { color: var(--label); }
.otd-more { font-size: 12.5px; color: var(--label-3); padding-top: 11px; border-top: 1px solid var(--hairline); }
