/* Layout concept: soft and modern, in the style of Apple's product pages.
   A light gray canvas with white cards, generous rounding and space, one
   sans-serif family, pill buttons and a single blue accent; colour otherwise
   only where it means something (status). Light first, dark follows the
   device. */
:root {
  --bg: #f5f5f7; --panel: #ffffff; --panel-solid: #ffffff; --panel-2: #f0f0f3;
  --line: rgba(0, 0, 0, 0.06); --line-strong: rgba(0, 0, 0, 0.14);
  --ink: #1d1d1f; --muted: #6e6e73; --faint: #a1a1a6;
  --accent: #0071e3; --accent-2: #2997ff; --accent-ink: #ffffff; --accent-soft: rgba(0, 113, 227, 0.1);
  --btn-bg: #0071e3; --btn-ink: #ffffff; --focus: #0071e3; --focus-soft: rgba(0, 113, 227, 0.18);
  --go: #1a8a42; --go-soft: rgba(26, 138, 66, 0.1); --wait: #b25e00; --wait-soft: rgba(178, 94, 0, 0.1);
  --warn: #d70015; --warn-soft: rgba(215, 0, 21, 0.07); --field: #ffffff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  --r-btn: 999px; --r-field: 12px; --r-card: 20px; --r-chip: 999px; --h-weight: 600; --h-track: -0.025em;
  --f-display: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #000000; --panel: #1c1c1e; --panel-solid: #1c1c1e; --panel-2: #2c2c2e;
    --line: rgba(255, 255, 255, 0.1); --line-strong: rgba(255, 255, 255, 0.2);
    --ink: #f5f5f7; --muted: #a1a1a6; --faint: #6e6e73;
    --accent: #2997ff; --accent-2: #64b5ff; --accent-ink: #ffffff; --accent-soft: rgba(41, 151, 255, 0.16);
    --btn-bg: #0a84ff; --btn-ink: #ffffff; --focus: #2997ff; --focus-soft: rgba(41, 151, 255, 0.25);
    --go: #30d158; --go-soft: rgba(48, 209, 88, 0.14); --wait: #ffb340; --wait-soft: rgba(255, 179, 64, 0.14);
    --warn: #ff6961; --warn-soft: rgba(255, 105, 97, 0.14); --field: #1c1c1e;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #000000; --panel: #1c1c1e; --panel-solid: #1c1c1e; --panel-2: #2c2c2e;
  --line: rgba(255, 255, 255, 0.1); --line-strong: rgba(255, 255, 255, 0.2);
  --ink: #f5f5f7; --muted: #a1a1a6; --faint: #6e6e73;
  --accent: #2997ff; --accent-2: #64b5ff; --accent-ink: #ffffff; --accent-soft: rgba(41, 151, 255, 0.16);
  --btn-bg: #0a84ff; --btn-ink: #ffffff; --focus: #2997ff; --focus-soft: rgba(41, 151, 255, 0.25);
  --go: #30d158; --go-soft: rgba(48, 209, 88, 0.14); --wait: #ffb340; --wait-soft: rgba(255, 179, 64, 0.14);
  --warn: #ff6961; --warn-soft: rgba(255, 105, 97, 0.14); --field: #1c1c1e;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); min-height: 100vh;
  font: 15px/1.6 var(--f-body);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-display); font-weight: var(--h-weight); line-height: 1.12; letter-spacing: var(--h-track); text-wrap: balance; margin: 0; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 16px; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; }
.brand::before { /* logomark: an open book drawn as two light planes */
  content: ''; width: 20px; height: 20px; border-radius: 4px; flex: none;
  background: var(--btn-bg);
  -webkit-mask: linear-gradient(#000 0 0) left / 45% 100% no-repeat, linear-gradient(#000 0 0) right / 45% 100% no-repeat;
          mask: linear-gradient(#000 0 0) left / 45% 100% no-repeat, linear-gradient(#000 0 0) right / 45% 100% no-repeat;
}
.brand b { font-family: var(--f-display); font-size: 1rem; font-weight: 600; letter-spacing: -0.02em; }
.brand span { font-family: var(--f-mono); font-size: 0.68rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.12em; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; }
.who { font-size: 0.85rem; color: var(--muted); font-family: var(--f-mono); }
main { padding-block: 56px 96px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; background: var(--btn-bg); color: var(--btn-ink);
  border-radius: var(--r-btn); padding: 9px 16px; font-weight: 500; cursor: pointer; font-size: 0.92rem; letter-spacing: -0.005em;
  transition: transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.btn:hover { background: color-mix(in srgb, var(--btn-bg) 86%, var(--bg)); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line-strong); }
.btn.go { background: var(--go); color: #fff; }
.btn.go:hover { background: color-mix(in srgb, var(--go) 88%, #000); }
.btn.small { padding: 5px 13px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 0.85rem; font-family: var(--f-mono); }
.linkish:hover { text-decoration: underline; }

label { display: grid; gap: 6px; font-size: 0.84rem; font-weight: 500; color: var(--ink); }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='date'], textarea, select {
  width: 100%; border: 1px solid var(--line-strong); background: var(--field); border-radius: var(--r-field);
  padding: 10px 12px; font-size: 0.98rem; font-weight: 400; color: var(--ink); min-width: 0;
  font-family: var(--f-body); text-transform: none; letter-spacing: normal;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type='number'], input[type='date'] { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
textarea { resize: vertical; min-height: 68px; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
form.stack { display: grid; gap: 16px; }
.error { color: var(--warn); font-size: 0.85rem; min-height: 1.2em; }
.field-error { margin-top: -10px; min-height: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.eyebrow { font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); }

.panel { background: var(--panel); border: 0; border-radius: var(--r-card); padding: 24px; box-shadow: var(--shadow); }

/* Sign-in */
.welcome { display: grid; gap: 40px; grid-template-columns: 1.25fr 1fr; align-items: start; padding-top: 12px; }
.welcome h1 { font-size: clamp(2.6rem, 6.5vw, 4.4rem); letter-spacing: var(--h-track); line-height: 1.04; margin-top: 16px; font-weight: var(--h-weight); }
.welcome h1 em { font-style: normal; color: var(--faint); }
:lang(zh) .welcome h1 em { white-space: nowrap; }
.welcome .lede { font-size: 1.12rem; color: var(--muted); margin-top: 20px; max-width: 32em; }
.steps { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 0; counter-reset: s; border-top: 1px solid var(--line); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: '0' counter(s); font-family: var(--f-mono); font-size: 0.78rem; color: var(--accent); letter-spacing: 0.06em; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; background: var(--panel-2); border-radius: calc(var(--r-btn) + 4px); }
.tabs button { flex: 1; background: none; border: 0; padding: 7px 14px; cursor: pointer; font-weight: 500; color: var(--muted); border-radius: var(--r-btn); font-size: 0.88rem; }
.tabs button[aria-selected='true'] { color: var(--ink); background: var(--panel-solid); box-shadow: var(--shadow); }

/* Home */
.home { display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr; align-items: start; }
.home h1 { font-size: 2.2rem; margin-top: 10px; }
.group-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.group-list .empty { grid-column: 1 / -1; }
.group-link {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  background: var(--panel); border: 0; box-shadow: var(--shadow); border-radius: var(--r-card); padding: 18px 20px;
  transition: border-color 150ms ease, transform 150ms ease;
}
.group-link:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 6px 16px -8px rgba(0, 0, 0, 0.18); transform: translateY(-1px); }
.group-link b { font-family: var(--f-display); font-size: 1.08rem; font-weight: 600; letter-spacing: -0.02em; }
.group-link span { font-family: var(--f-mono); }
.empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 22px; color: var(--muted); }
.side { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); } /* shrink to the screen, never past it */
.side h2 { font-size: 1.1rem; letter-spacing: -0.02em; }

/* Group header */
.ghead { display: flex; flex-wrap: wrap; align-items: end; gap: 14px 24px; margin-bottom: 22px; }
.ghead h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin-right: auto; letter-spacing: var(--h-track); font-weight: var(--h-weight); }
.invite { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 0; box-shadow: var(--shadow); border-radius: var(--r-card); padding: 5px 5px 5px 14px; }
.invite .eyebrow { color: var(--faint); }
.invite code { font-family: var(--f-mono); font-size: 1rem; font-weight: 500; letter-spacing: 0.18em; color: var(--ink); }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 0.82rem; font-family: var(--f-mono); text-decoration: none; }
.back:hover { color: var(--ink); }

.today {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 22px;
  padding: 12px 16px; border-radius: var(--r-card); background: var(--panel); box-shadow: var(--shadow);
}
.today strong { font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; }
.today strong::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 3px var(--go-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; padding: 3px 10px 3px 4px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.chip.done { border-color: color-mix(in srgb, var(--go) 50%, transparent); }
.chip.done::after { content: '✓'; color: var(--go); font-weight: 700; }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.68rem; font-weight: 600; color: #fff; flex: none; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.cards { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }

/* Member panel */
.ccard {
  position: relative; background: var(--panel); border: 0; border-radius: var(--r-card);
  box-shadow: var(--shadow); padding: 22px 24px; overflow: hidden;
}
.ccard.mine { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow); }
.ccard .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ccard .who-line { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-right: auto; font-size: 0.92rem; }
.book { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; margin-top: 14px; align-items: start; }
.book h3 { font-size: 1.5rem; letter-spacing: var(--h-track); }
.book .by { color: var(--muted); margin-top: 4px; font-size: 0.92rem; }
.book .pill { margin-top: 8px; }
/* One member can read several books; each sits in its own block. */
.rbook + .rbook { margin-top: 22px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.add-book-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ask-book { display: grid; gap: 6px; font-size: 0.86rem; color: var(--muted); }
.stamp { /* the deadline, as a mono DUE tag */
  font-family: var(--f-mono); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; text-align: left; line-height: 1.2; white-space: nowrap; background: var(--panel-2);
}
.stamp small { display: block; font-size: 0.6rem; letter-spacing: 0.16em; color: var(--accent); }
.stamp b { font-size: 0.92rem; font-weight: 500; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }

.pill { font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px 3px 7px; border-radius: 99px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.none { background: var(--panel-2); color: var(--muted); border-color: var(--line); }
.pill.pending { background: var(--wait-soft); color: var(--wait); }
.pill.changes { background: var(--warn-soft); color: var(--warn); }
.pill.active { background: var(--go-soft); color: var(--go); }
.pill.finished { background: var(--accent-soft); color: var(--accent); }
.pill.overdue { background: var(--warn-soft); color: var(--warn); }

.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; font-family: var(--f-mono); }
.meta b { color: var(--ink); font-weight: 500; }
.bar { position: relative; height: 6px; background: var(--panel-2); border-radius: 99px; margin-top: 18px; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--btn-bg); }
.bar > em { position: absolute; top: -5px; bottom: -5px; width: 2px; border-radius: 2px; background: var(--ink); opacity: 0.6; }
.ledger { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.ledger span { position: relative; width: 13px; height: 13px; border-radius: 3px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.ledger span.on { background: var(--go); box-shadow: none; }
.ledger span.now { box-shadow: inset 0 0 0 1.5px var(--accent); }
.ledger span.now::after { content: ''; position: absolute; inset: 0; margin: auto; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ledger span.now.on { box-shadow: none; }
.ledger span.now.on::after { background: #fff; }
.ledger span.off { opacity: 0.35; }

.signoff { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 0.88rem; }
.sigs { display: flex; flex-wrap: wrap; gap: 6px; }
.sig { font-size: 0.78rem; padding: 2px 9px; border-radius: 99px; border: 1px dashed var(--line-strong); color: var(--muted); font-family: var(--f-mono); }
.sig.ok { border-style: solid; border-color: color-mix(in srgb, var(--go) 50%, transparent); color: var(--go); background: var(--go-soft); }
.sig.ok::before { content: '✓ '; }
.note { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 10px; padding: 9px 12px; font-size: 0.88rem; }
.note b { color: var(--warn); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.desk { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.desk h3 { letter-spacing: -0.02em; }
.pace { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pace label {
  cursor: pointer; border: 1px solid var(--line-strong); border-radius: var(--r-field); padding: 10px 12px; color: var(--ink);
  background: transparent; gap: 2px; font-size: 0.9rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.pace label:has(input:checked) { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); background: var(--panel-solid); }
.pace input[type='radio'] { position: absolute; opacity: 0; pointer-events: none; }
.pace b { font-size: 0.92rem; font-weight: 600; }
.pace span { font-size: 0.74rem; color: var(--muted); font-family: var(--f-mono); }
fieldset legend { font-size: 0.84rem !important; font-weight: 500 !important; }
.reco {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 0.88rem; border-radius: 10px; padding: 10px 12px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.reco b { font-family: var(--f-mono); font-weight: 500; }

.feed { display: grid; gap: 0; }
.feed h2 { font-size: 1.1rem; margin-bottom: 10px; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; }
.feed h2::after { content: attr(data-live); font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.14em; color: var(--go); border: 1px solid color-mix(in srgb, var(--go) 40%, transparent); border-radius: 99px; padding: 1px 7px; font-weight: 500; }
.feed .item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 0.88rem; }
.feed .item q { display: block; color: var(--muted); margin-top: 3px; quotes: '“' '”'; overflow-wrap: anywhere; }
.feed time { display: block; margin-top: 3px; font-family: var(--f-mono); font-size: 0.7rem; color: var(--faint); }
.rule-box { font-size: 0.82rem; color: var(--muted); margin-top: 4px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); border: 0; padding: 10px 18px; border-radius: var(--r-btn); font-size: 0.88rem; z-index: 10; box-shadow: var(--shadow);
}
.loading { color: var(--muted); padding: 40px 0; font-family: var(--f-mono); font-size: 0.85rem; }

@media (max-width: 760px) {
  .brand span { display: none; }
  /* minmax(0, ...) lets the column shrink to the screen; a plain 1fr grows to fit
     its widest line, which pushed circle pages past the edge of narrow phones. */
  .welcome, .home, .layout { grid-template-columns: minmax(0, 1fr); }
  .welcome { gap: 28px; }
  .book { grid-template-columns: auto minmax(0, 1fr); }
  .book .stamp { grid-column: 2; }
  .stamp { justify-self: start; }
  .pace { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .stamp.fresh { animation: lock-in 520ms cubic-bezier(.2, .9, .3, 1.2); }
  @keyframes lock-in { from { box-shadow: 0 0 0 6px var(--accent-soft); border-color: var(--accent); } }
  .bar > i { transition: width 600ms cubic-bezier(.2, .8, .2, 1); }
  .today strong::before { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
}

/* Measuring a book, custom pace, reading lists and suggestions */
.pace.units { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pace.paces { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pace .custom-ppd { margin-top: 6px; width: 100%; padding: 6px 8px; font-size: 0.85rem; }
.pace label.is-custom:not(:has(input:checked)) .custom-ppd { display: none; }
.from-list select { width: 100%; }
.suggest {
  position: absolute; z-index: 20; margin: 0; padding: 4px; list-style: none; max-height: 320px; overflow-y: auto;
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
}
.suggest li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; cursor: pointer; font-size: 0.9rem; }
.suggest li > div { display: grid; gap: 1px; min-width: 0; }
.suggest li:hover, .suggest li.on { background: var(--panel-2); }
.suggest li > div span { font-size: 0.76rem; color: var(--muted); }
.shelf { display: grid; gap: 0; margin-top: 4px; }
.shelf .row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.shelf .row div { flex: 1; min-width: 0; }
.shelf .row > div span { display: block; font-size: 0.76rem; color: var(--muted); }
@media (max-width: 760px) {
  .pace.paces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pace.units { grid-template-columns: 1fr; }
}
.topbar .lang { min-width: 3.2em; }

/* Page flow: a heading, then numbered sections read top to bottom */
.page-head { margin-bottom: 48px; max-width: 44em; }
.page-head h1 { font-size: clamp(2.4rem, 5.5vw, 3.6rem); margin-top: 12px; letter-spacing: var(--h-track); font-weight: var(--h-weight); line-height: 1.05; }
.page-head p.muted { margin-top: 14px; font-size: 1.08rem; max-width: 36em; }
.block { margin-top: 64px; }
.block:first-of-type { margin-top: 0; }
.block-head { display: flex; gap: 16px; align-items: baseline; margin-bottom: 22px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.block-head h2 { font-size: clamp(1.3rem, 2.6vw, 1.6rem); }
.block-head p { margin-top: 4px; max-width: 46em; }
.num { font-family: var(--f-mono); font-size: 0.78rem; color: var(--accent); letter-spacing: 0.06em; }
.panel h3 { font-size: 1.05rem; }
.list-layout { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.panel.shelf { display: flex; flex-direction: column; }
.panel.shelf > h3 { padding: 18px 0 10px; }
.shelf-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 28px 0 36px; }
/* Start or join: one panel under the circles, two short forms side by side */
.circle-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0; margin-top: 16px; }
.inline-form { display: grid; gap: 12px; padding: 22px 24px 12px; }
.inline-form + .inline-form { border-left: 1px solid var(--line); }
.inline-row { display: flex; gap: 8px; margin-top: 6px; }
.inline-row input { flex: 1; min-width: 0; }
.inline-row .btn { flex: none; }
@media (max-width: 720px) {
  .circle-actions { grid-template-columns: 1fr; }
  .inline-form + .inline-form { border-left: 0; border-top: 1px solid var(--line); }
}
.panel.shelf { padding: 6px 24px 14px; margin: 0; }
.panel.shelf > p { padding: 14px 0; }
.shelf .row:first-child { border-top: 0; }
.shelf .row.on b { color: var(--accent); }
.step-head { display: flex; align-items: center; gap: 10px; padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 4px; }
form.stack > .step-head:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.step-head .num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); font-size: 0.7rem; }
.step-head b { font-size: 0.95rem; letter-spacing: -0.01em; }
.guide-ico { flex: none; display: block; }

/* User guide */
dialog.guide {
  width: min(640px, calc(100vw - 32px)); max-height: min(86vh, 900px); padding: 0; border: 1px solid var(--line-strong);
  border-radius: var(--r-card); background: var(--panel-solid); color: var(--ink); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.45);
}
dialog.guide::backdrop { background: rgba(20, 20, 19, 0.4); backdrop-filter: blur(4px); }
.guide-inner { padding: 22px 24px 24px; display: grid; gap: 16px; }
.guide-top { display: flex; align-items: center; gap: 12px; }
.guide-top h2 { font-size: 1.4rem; margin-right: auto; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.guide-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.guide-steps .num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); color: var(--accent); font-weight: 600; font-size: 0.85rem; }
.guide-steps b { font-size: 0.98rem; }
.guide-steps p { margin: 2px 0 0; font-size: 0.9rem; color: var(--muted); }
@media (max-width: 760px) {
  .list-layout { grid-template-columns: 1fr; }
  .guide-btn { padding-inline: 8px; }
  .topbar .who { display: none; }
}

/* Book ideas */
.ideas-tabs { max-width: 320px; margin-bottom: 12px; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.cats .cat { font: inherit; font-size: 0.84rem; padding: 6px 14px; border-radius: var(--r-chip); cursor: pointer; color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); }
.cats .cat:hover { background: var(--panel-2); }
.cats .cat.on { color: var(--btn-ink); border-color: var(--btn-bg); background: var(--btn-bg); font-weight: 500; }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.idea { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 0; box-shadow: var(--shadow); border-radius: var(--r-card); background: var(--panel); transition: box-shadow 150ms ease, transform 150ms ease; }
.idea:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 8px 20px -10px rgba(0, 0, 0, 0.18); transform: translateY(-1px); }
.idea b { font-weight: 600; font-size: 1rem; line-height: 1.3; letter-spacing: -0.01em; margin-top: 2px; }
.idea .btn, .idea .on-list { margin-top: auto; align-self: flex-start; }
.idea .eyebrow { font-size: 0.68rem; }
.idea .on-list { font-size: 0.8rem; color: var(--go); font-weight: 600; padding: 6px 0; }
.ideas-link { margin-top: auto; }
.shelf .row:last-of-type { margin-bottom: 14px; }
@media (max-width: 560px) { .idea-grid { grid-template-columns: 1fr; gap: 10px; } .idea { padding: 16px; } }
.idea-notes { display: grid; gap: 8px; margin: 8px 0 4px; font-size: 0.84rem; line-height: 1.5; }
.idea-notes p { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.idea-notes .about { -webkit-line-clamp: 3; color: var(--ink); }
.idea-notes .said { color: var(--muted); padding-left: 10px; border-left: 2px solid var(--line-strong); display: grid; gap: 6px; }
.idea-notes .said > p { -webkit-line-clamp: 3; }
.idea-notes .said > span { display: block; font-size: 0.72rem; font-weight: 600; color: var(--faint); }
.said blockquote { margin: 0; }
.said blockquote p { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; -webkit-line-clamp: 3; color: var(--ink); }
.said cite { display: block; font-style: normal; font-size: 0.74rem; color: var(--faint); margin-top: 2px; }
.said .stars { color: #f5a623; letter-spacing: 1px; margin-left: 4px; }
.said .src { font-size: 0.74rem; color: var(--accent); text-decoration: none; }
.said .src:hover { text-decoration: underline; }
/* collapsed cards show one quote; Read more shows the rest */
.idea:not(.open) .said blockquote + blockquote, .idea:not(.open) .said .src { display: none; }
.idea.open .said blockquote p { -webkit-line-clamp: unset; }
.idea.open .idea-notes p { -webkit-line-clamp: unset; }
.idea .more { align-self: flex-start; font-family: var(--f-body); font-size: 0.8rem; color: var(--accent); margin-bottom: 12px; }

/* Book covers: the real cover photo; a plain loading box while it is looked
   up; the drawn cover (the title on a colour) when there is none, or when
   drawn covers are chosen */
.cover {
  position: relative; flex: none; display: block; overflow: hidden; aspect-ratio: 2 / 3;
  border-radius: 4px 6px 6px 4px; background: linear-gradient(160deg, hsl(var(--h) 45% 62%), hsl(var(--h) 50% 42%));
  box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 12px -6px rgba(0, 0, 0, 0.3);
}
.cover .ph {
  position: absolute; inset: 0; padding: 12% 10% 0 14%; color: #fff; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em;
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.has-img { background: var(--panel-2); }
.cover.has-img .ph { visibility: hidden; }
html:not(.covers-drawn) .cover.loading { background: var(--panel-2); }
html:not(.covers-drawn) .cover.loading .ph { visibility: hidden; }
html:not(.covers-drawn) .cover.loading::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, var(--line) 50%, transparent 70%) 0 0 / 250% 100%;
  animation: cover-shimmer 1.4s ease-in-out infinite;
}
@keyframes cover-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { html:not(.covers-drawn) .cover.loading::after { animation: none; } }
.covers-drawn .cover img { display: none; }
.covers-drawn .cover.has-img { background: linear-gradient(160deg, hsl(var(--h) 45% 42%), hsl(var(--h) 40% 28%)); }
.covers-drawn .cover.has-img .ph { visibility: visible; }
/* Cover switch in the top bar: a small book-cover icon, filled when real covers are on */
.cover-ico { display: inline-block; width: 10px; height: 14px; border: 1.5px solid currentColor; border-radius: 2px; margin-right: 6px; vertical-align: -2px; }
.cover-btn[aria-pressed='true'] .cover-ico { background: currentColor; }

.topbar .btn, .brand b { white-space: nowrap; }
/* Keep the top bar within a phone's width once "Sign out" joins it. */
@media (max-width: 480px) { .topbar .wrap { gap: 6px; } }
@media (max-width: 400px) {
  #topbar { gap: 4px; }
  .topbar .btn.small { padding-inline: 9px; }
  .topbar .brand span { display: none; }
  /* if the buttons still need the room (wider fonts), shorten the name, never the buttons */
  .topbar .brand { min-width: 0; }
  .topbar .brand b { overflow: hidden; text-overflow: ellipsis; }
  .topbar .btn { flex: none; }
}
.cover.xs { width: 30px; font-size: 0.32rem; }
.cover.xs .ph { -webkit-line-clamp: 3; padding: 10% 8% 0 12%; }
.cover.s { width: 38px; font-size: 0.4rem; }
.cover.m { width: 92px; font-size: 0.72rem; margin-bottom: 10px; }
.cover.l { width: 64px; font-size: 0.5rem; }
.shelf .row .cover { align-self: center; }
@media (max-width: 560px) { .cover.m { width: 80px; } .cover.l { width: 54px; } }

/* Reading now: your books in progress, at the top of home */
.reading-now { display: grid; gap: 10px; margin: -16px 0 56px; }
.now-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; text-decoration: none; color: inherit;
  background: var(--panel); border-radius: var(--r-card); padding: 16px 20px; box-shadow: var(--shadow); transition: box-shadow 150ms ease, transform 150ms ease;
}
.now-card:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 8px 20px -10px rgba(0, 0, 0, 0.18); transform: translateY(-1px); }
.now-card.todo { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow); }
.now-main { display: grid; gap: 4px; min-width: 0; }
.now-main b { font-size: 1.15rem; letter-spacing: -0.015em; }
.now-main .bar { margin-top: 6px; }
.now-meta { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.now-side { display: grid; gap: 8px; justify-items: end; text-align: right; }
.now-state { font-size: 0.82rem; font-weight: 500; color: var(--accent); }
.now-card.done .now-state { color: var(--go); }
@media (max-width: 560px) {
  .now-card { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; gap: 14px; }
  .now-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; }
}

/* Check-in done: the pop-up with the shareable picture */
dialog.done { width: min(520px, calc(100vw - 32px)); max-height: min(92vh, 960px); }
.done-body { display: grid; gap: 18px; }
.done-think .ask { margin: 0; padding: 14px 16px; }
.done-think .ask-q { font-size: 1rem; margin: 4px 0 10px; }
.ask-head { display: flex; gap: 10px; align-items: flex-start; }
.ask-head .ask-q { flex: 1; min-width: 0; }
.icon-btn {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin-top: 2px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); cursor: pointer;
  transition: background-color 160ms ease, transform 300ms ease;
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn:active svg { transform: rotate(-90deg); }
.icon-btn svg { transition: transform 300ms ease; }
.icon-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.ask.loading .icon-btn svg { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.done-share .share-msg:empty { display: none; }
.done-think .ask-form { gap: 8px; }
.done-think .ask-form textarea { min-height: 64px; height: auto; max-height: 220px; resize: none; field-sizing: content; overflow-y: auto; }
.done-share .switch { justify-self: start; font-size: 0.86rem; }
.done-share { display: grid; gap: 12px; align-content: start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.done-share h3 { margin: 0; }
.done-share .share-preview { max-height: 46vh; max-width: calc(46vh * 0.8); }
@media (min-width: 900px) {
  dialog.done { width: min(860px, calc(100vw - 48px)); }
  .done-body { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); align-items: stretch; gap: 24px; }
  .done-think { display: flex; }
  .done-think .ask { flex: 1; display: flex; flex-direction: column; }
  .done-think .ask-form:not([hidden]) { flex: 1; display: flex; flex-direction: column; }
  .done-think .ask-form textarea { flex: 1; max-height: none; field-sizing: fixed; }
  .done-think .ask .actions { margin-top: auto; }
  .done-share { padding: 0 24px 15px 0; border-bottom: 0; border-right: 1px solid var(--line); }
  .done-share .share-preview { max-height: 58vh; max-width: min(100%, calc(58vh * 0.8)); }
}
dialog.done .ask .actions .btn { white-space: nowrap; }
.done-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.done-head h2 { font-size: 1.4rem; }
.done-head p { margin-top: 4px; font-size: 0.92rem; }
.done-check {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--go); color: #fff; font-weight: 700; font-size: 1.3rem;
  animation: pop 420ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }
.share-preview { margin: 0; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; max-height: 56vh; justify-self: center; width: 100%; max-width: calc(56vh * 0.8); }
.share-preview img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fade 300ms ease both; }
@keyframes fade { from { opacity: 0; } }
.share-wait { color: var(--muted); font-size: 0.9rem; }
dialog.done .actions { display: flex; gap: 10px; flex-wrap: wrap; }
dialog.done .actions .btn { flex: 1; }
.share-msg { min-height: 1.2em; text-align: center; margin-top: -6px; }
@media (prefers-reduced-motion: reduce) { .done-check, .share-preview img { animation: none; } }
/* On/off switch */
.switch { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; cursor: pointer; justify-self: center; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; flex: none; width: 42px; height: 26px; border-radius: 13px; background: var(--line-strong); transition: background 160ms ease; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 160ms ease; }
.switch input:checked + .track { background: var(--go); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Reading questions: the question block and the circle's Thinking list */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ask { margin: 18px 0 6px; padding: 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 7%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.ask-q { font-size: 1.08rem; line-height: 1.45; margin: 6px 0 12px; letter-spacing: -0.01em; font-weight: 500; }
.ask.loading .ask-q { color: var(--muted); font-weight: 400; }
.ask-form { gap: 10px; }
.ask-form textarea { min-height: 84px; }
.ask .switch { justify-self: start; font-size: 0.86rem; }
.ask .error:empty { display: none; }
.ask .actions { margin-top: 0; }
.ask-answer, .thought blockquote { margin: 0; padding: 2px 0 2px 12px; border-left: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-saved { margin-top: 10px; color: var(--go); font-family: var(--f-mono); }
.thinking { display: grid; gap: 0; }
.thinking-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.thinking-head h2 { font-size: 1.1rem; letter-spacing: -0.015em; }
.thought { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.thought.locked { align-items: center; }
.thought-meta { color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.thought-meta b { color: var(--ink); font-weight: 600; }
.thought-meta .kind { margin-left: auto; font-family: var(--f-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.thought-q { color: var(--muted); margin: 4px 0 6px; font-size: 0.86rem; }
.thought-own { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 8px; }
.thought-own .linkish { white-space: nowrap; }
.thought-own .vis { font-family: var(--f-mono); font-size: 0.72rem; color: var(--faint); }
.thought-own .vis.on { color: var(--go); }
.ai-check { max-width: 640px; } .ai-check h1 { font-size: 1.6rem; } .ai-ok { color: var(--go); font-weight: 500; }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.react-chip { font: inherit; font-size: 0.76rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
span.react-chip { cursor: default; }
button.react-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.react-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.replies { margin-top: 8px; display: grid; gap: 4px; justify-items: start; }
.reply { color: var(--muted); overflow-wrap: anywhere; }
.reply b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.reply-form { display: flex; gap: 6px; width: 100%; }
.reply-form input { flex: 1; min-width: 0; padding: 6px 10px; font-size: 0.85rem; }
.ask-saved .linkish { margin-left: 10px; }

/* A book shared through a picture's QR code, floating on the right */
.shared-book { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 300px; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08); animation: shared-in 320ms ease-out; }
.shared-book .close { position: absolute; top: 10px; right: 10px; padding: 3px 9px; }
.shared-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; margin: 10px 0 14px; }
.shared-main h3 { font-size: 1.05rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.shared-actions { display: grid; gap: 8px; }
.shared-actions .btn { width: 100%; }
.shared-actions .ok { color: var(--go); font-family: var(--f-mono); }
.switches { display: grid; gap: 10px; justify-items: center; }
@keyframes shared-in { from { opacity: 0; transform: translateY(16px); } }
@media (max-width: 720px) { .shared-book { position: relative; right: auto; bottom: auto; width: auto; margin-bottom: 20px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); } }
@media (prefers-reduced-motion: reduce) { .shared-book { animation: none; } }

/* #cover-check */
.cover-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cover-rows li { overflow-wrap: anywhere; }
.cover-rows .ok { color: var(--go); }
.cover-rows .bad { color: var(--warn); }
.cover-check h3 { margin-top: 8px; }

/* Votes, articles, recommendations and notifications */
.unread-badge { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-family: var(--f-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.02em; }
.votes { margin-top: 12px; display: grid; gap: 2px; }
.votes > .muted { font-family: var(--f-mono); font-size: 0.72rem; }
.votes .reacts { margin-top: 4px; }
.vote-chip.for[aria-pressed="true"] { background: var(--go-soft); border-color: color-mix(in srgb, var(--go) 45%, transparent); color: var(--go); }
.vote-chip.against[aria-pressed="true"] { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); }
.vote-tag { font-family: var(--f-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; margin-right: 6px; }
.vote-tag.for { color: var(--go); }
.vote-tag.against { color: var(--warn); }
.votes-empty { margin-top: 10px; }
.from-rec { margin-top: 6px; }
.stop-link { margin-left: auto; color: var(--muted); }
.btn.danger { background: var(--warn); color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--warn) 88%, #000); }
.cease-form p b { letter-spacing: -0.01em; }
.add-book-row .muted { margin-left: auto; }
.articles { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 0; }
.article { padding: 12px 0; border-top: 1px dashed var(--line); font-size: 0.9rem; }
.articles .eyebrow + .article { border-top: 0; padding-top: 8px; }
.art-main { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.art-main a, .art-main b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.art-main a:hover { color: var(--accent); }
.art-main span.muted { display: block; margin-top: 2px; }
.art-ico { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--muted); font-size: 0.75rem; }
.article.read .art-ico { background: var(--go-soft); color: var(--go); }
.art-note { margin: 8px 0 0 32px; padding-left: 10px; border-left: 2px solid var(--line-strong); color: var(--ink); overflow-wrap: anywhere; }
.article .reacts, .article .replies, .article .thought-own { margin-left: 32px; }
.notices { display: grid; gap: 0; }
.notice { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; text-align: left; font: inherit; font-size: 0.86rem; color: var(--ink); background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 6px; margin: 0 -6px; border-radius: 8px; cursor: pointer; }
.notice:hover { background: var(--panel-2); }
.notice.new { background: var(--accent-soft); }
.notice q { display: block; color: var(--muted); margin-top: 2px; quotes: '“' '”'; overflow-wrap: anywhere; }
.notice time { display: block; margin-top: 2px; font-family: var(--f-mono); font-size: 0.7rem; color: var(--faint); }
.recs { display: grid; gap: 0; }
.rec { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 0.9rem; }
.rec .ink { color: var(--ink); font-weight: 600; }
.rec-book { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.rec-book b, .rec-book a { display: block; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.rec-book .muted { display: block; }
.rec q { color: var(--muted); quotes: '“' '”'; overflow-wrap: anywhere; }
.rec .actions { margin-top: 2px; }
.flash { animation: flash 1.6s ease-out; border-radius: 12px; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px var(--focus-soft); } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }
/* Keep the top bar within a phone's width. */


/* Top bar: link back to the main site, and the tools group */
.site-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 0.82rem; white-space: nowrap; padding: 4px 2px; margin-left: -4px; }
.site-link:hover { color: var(--ink); }
.topbar .tools { display: flex; align-items: center; gap: 12px; }
/* Phones: brand and sign out on the first row, the labelled tools on a second row */
@media (max-width: 560px) {
  .topbar .wrap { flex-wrap: wrap; gap: 8px 6px; padding-block: 10px; }
  .site-link .label { display: none; }
  .topbar .tools { order: 3; flex: 1 0 100%; gap: 6px; }
  .topbar .tools .btn { padding-inline: 10px; }
  .topbar .tools .lang { margin-left: auto; }
}

/* ---------- Sign-in, privacy and account ---------- */
a.who { text-decoration: none; }
a.who:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.method { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; background: var(--panel-2); border-radius: calc(var(--r-btn) + 4px); }
.method button { flex: 1; background: none; border: 0; padding: 8px 10px; cursor: pointer; font-weight: 500; color: var(--muted); border-radius: var(--r-btn); font-size: 0.86rem; }
.method button[aria-pressed='true'] { color: var(--ink); background: var(--panel-solid); box-shadow: var(--shadow); }
.auth-panel .tabs { background: none; padding: 0; gap: 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); border-radius: 0; }
.auth-panel .tabs button { flex: 0 0 auto; padding: 6px 0 10px; border-radius: 0; margin-bottom: -1px; }
.auth-panel .tabs button[aria-selected='true'] { background: none; box-shadow: none; border-bottom: 2px solid var(--accent); }
.code-input { font-family: var(--f-mono); font-size: 1.4rem; letter-spacing: 0.35em; text-align: center; }
.code-links { margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.code-links p { margin: 0; }
.pw { position: relative; display: block; }
.pw input { padding-right: 68px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  color: var(--accent); font: 500 0.8rem var(--f-body);
}
.pw-toggle:hover { background: var(--accent-soft); }
.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: -8px; font-size: 0.8rem; color: var(--muted); min-height: 1.2em; }
.pw-meter .pw-bar { display: inline-flex; gap: 3px; }
.pw-meter .pw-bar i { display: block; width: 22px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.pw-meter[data-level='short'] .pw-bar i:nth-child(-n+1), .pw-meter[data-level='common'] .pw-bar i:nth-child(-n+1), .pw-meter[data-level='weak'] .pw-bar i:nth-child(-n+1) { background: var(--warn); }
.pw-meter[data-level='good'] .pw-bar i:nth-child(-n+2) { background: var(--wait); }
.pw-meter[data-level='strong'] .pw-bar i { background: var(--go); }
.pw-meter[data-level='short'], .pw-meter[data-level='common'] { color: var(--warn); }
.trust {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 22px; padding: 14px 16px;
  background: var(--go-soft); border-radius: var(--r-field); font-size: 0.84rem; line-height: 1.5;
}
.trust > svg { color: var(--go); margin-top: 2px; }
.trust b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.trust p { margin: 0 0 6px; color: var(--muted); }
.trust a { color: var(--accent); font-weight: 500; }
.privacy .block { margin-top: 40px; }
.privacy-list { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; max-width: 44em; color: var(--ink); }
.privacy-list li::marker { color: var(--faint); }
.privacy-list a, .privacy-foot a { color: var(--accent); }
.privacy-foot { margin-top: 48px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 0; max-width: 36em; }
.facts dt { color: var(--muted); font-size: 0.86rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .mono { font-family: var(--f-mono); font-size: 0.9rem; }
form.stack.narrow { max-width: 26em; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin-bottom: 14px; }
label.check input { width: auto; }
.danger-zone .block-head h2 { color: var(--warn); }
.btn.danger:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
}

/* Sign-in panel: one title, one way in, and a quiet link for older accounts. */
.auth-title { font-size: 1.15rem; margin: 0 0 12px; }
.auth-intro { margin: 0 0 16px; }
.auth-alt { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.phone-row { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); gap: 10px; }
.phone-row label { min-width: 0; }
.phone-row input, .phone-row select { width: 100%; min-width: 0; box-sizing: border-box; }
label.check.small { font-size: 0.85rem; align-items: flex-start; }
label.check.small input { margin-top: 3px; }
.contact-nudge { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.contact-nudge p { margin: 4px 0 0; }

/* Start reading from the reading list */
.circle-picks { display: grid; gap: 8px; }
.circle-picks .check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
@media (max-width: 560px) {
  .shelf .row { flex-wrap: wrap; }
  .shelf .row > div { flex-basis: calc(100% - 60px); }
  .shelf .row .btn { flex: 1; }
}

/* Create account / Sign in tabs, and the code field with its send button */
.auth-tabs { display: flex; gap: 4px; margin: 0 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.auth-tab { flex: 1; padding: 8px 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.auth-tab.on { background: var(--ink); color: var(--bg); }
.auth-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.code-row { display: flex; gap: 8px; align-items: flex-end; }
.code-row label { flex: 1; min-width: 0; }
.code-row .btn { flex: none; margin-bottom: 1px; }
.field-hint { margin: -6px 0 0; }
.auth-alt .linkish, .code-links .linkish { font: inherit; }

/* After a check-in: copy it to the same book in other circles */
.done-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.done-sync p { margin: 0; flex: 1 1 220px; }
.done-sync .error:empty { display: none; }
.done-sync[hidden] { display: none; }

/* ---------- Notifications ---------- */
.nf { display: grid; gap: 18px; }
.nf-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.nf-channel { display: grid; gap: 8px; align-content: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.nf-channel p { margin: 0; }
.nf-channel .switch { justify-self: start; font-size: 0.86rem; }
.nf fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.nf legend { font-weight: 600; padding: 0 6px; }
.nf-when label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nf input[type='time'] { width: auto; min-width: 7.5em; }
.nf-days, .nf-quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nf-days > .small, .nf-quiet > .small { min-width: 6em; }
.nf-days .day { position: relative; }
.nf-days .day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nf-days .day span { display: inline-block; min-width: 2.6em; text-align: center; padding: 5px 8px; border-radius: 99px; border: 1px solid var(--line-strong); font-size: 0.82rem; cursor: pointer; }
.nf-days .day input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.nf-days .day input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.nf-table-wrap { overflow-x: auto; }
.nf-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.nf-table th, .nf-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.nf-table thead th { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.nf-table th[scope='row'], .nf-table thead th:first-child { text-align: left; }
.nf-table th[scope='row'] b { display: block; font-weight: 600; }
.nf-table th[scope='row'] span { display: block; font-weight: 400; margin-top: 2px; }
.nf-table td.off { opacity: 0.45; }
.nf-table .switch { justify-content: center; }
.small-switch .track { width: 36px; height: 22px; }
.small-switch .track::after { width: 16px; height: 16px; }
.small-switch input:checked + .track::after { transform: translateX(14px); }
.nf-mute .check { display: flex; gap: 8px; align-items: center; }
.nf-paused { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--wait-soft); color: var(--wait); }
.nf-status:empty { display: none; }
.done-remind { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 12px; background: var(--accent-soft); }
.done-remind p { margin: 4px 0 0; }
.done-remind .error:empty { display: none; }
.nudge-btn { margin-left: 4px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent; color: var(--accent); cursor: pointer; font: inherit; font-size: 0.76rem; }
.nudge-btn:hover { background: var(--accent-soft); }
.nudged { margin-left: 4px; color: var(--muted); font-size: 0.76rem; }
.nudge-form { display: grid; gap: 10px; margin: -6px 0 18px; padding: 16px; max-width: 32em; }
@media (max-width: 560px) {
  .nf-table th, .nf-table td { padding: 8px 3px; }
  .nf-table th[scope='row'] span { display: none; }
}
