/* Commonplace: /commonplace, /quote/<id> and /review.
   docs/superpowers/specs/2026-11-07-commonplace-design.md

   Every card on the wall is the same size by construction: a header of
   fixed height, a quote with exactly three lines of room, and a single
   row of pills. Nothing in a card may wrap or grow except the quote, and
   that only when a reader taps Read more. */

.cp-page {
  --cp-hero-bg: #f4cf3c;
  --cp-hero-ink: #121212;
  --cp-card: color-mix(in srgb, var(--paper) 92%, white);
  --cp-card-shadow: 0 1px 1px rgba(0, 0, 0, 0.04), 0 10px 30px -14px rgba(0, 0, 0, 0.16);
  --cp-pill: color-mix(in srgb, var(--ink) 6%, transparent);
  --cp-paper-back: #e8e1cf;
}
:root[data-theme="dark"] .cp-page {
  --cp-hero-bg: #111;
  --cp-hero-ink: #f2ede0;
  --cp-card: #1c1c1c;
  --cp-card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  --cp-paper-back: #cfc8b6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cp-page {
    --cp-hero-bg: #111;
    --cp-hero-ink: #f2ede0;
    --cp-card: #1c1c1c;
    --cp-card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 40px -18px rgba(0, 0, 0, 0.8);
    --cp-paper-back: #cfc8b6;
  }
}

.cp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- the hero: the clippings object in front of one line of type ---------- */

.cp-hero {
  position: relative;
  height: min(86svh, 700px);
  min-height: 520px;
  overflow: hidden;
  background: var(--cp-hero-bg);
  color: var(--cp-hero-ink);
  cursor: pointer;
}
/* One line across the width. 11.4vw keeps the ~7.8em line inside the
   window at every width; the clamp caps it on very wide screens. */
.cp-giant {
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: 13%;
  text-align: center;
  white-space: nowrap;
  font: 400 clamp(30px, 11.4vw, 204px) / 0.92 "New York", "Iowan Old Style", Georgia, serif;
  letter-spacing: -0.04em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cp-giant.in { opacity: 1; transform: none; }
.cp-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}
/* The still, shown without WebGL or with Reduce Motion: where the object
   stands, at its size. The PNG (scripts/dev/cpstill.mjs) is 460 tall around
   a 392-tall object, so it is 66% of the band where the object is 56%,
   centred 11% below the middle. */
.cp-still {
  display: none;
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 28%;
  height: 66%;
  width: auto;
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
}
html.cp-static .cp-canvas { display: none; }
html.cp-static .cp-still-light { display: block; }
:root[data-theme="dark"].cp-static .cp-still-light { display: none; }
:root[data-theme="dark"].cp-static .cp-still-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]).cp-static .cp-still-light { display: none; }
  :root:not([data-theme="light"]).cp-static .cp-still-dark { display: block; }
}
@media (max-width: 760px) {
  .cp-giant { top: 78px; }
  .cp-still { top: 31%; height: 58%; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-giant { transition: none; }
}

/* ---------- intro and tabs ---------- */

.cp-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding-top: 30px;
}
.cp-intro p { margin: 0; color: var(--ink-2); font-size: 18px; max-width: 620px; }
/* the offer in the intro, drawn over with the highlighter */
.cp-deal-mark {
  color: var(--ink);
  font-weight: 600;
  padding: 1px 3px;
  margin: -1px -1px;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  background: var(--hl-yellow);
}
.cp-sheet-head .deal { margin-left: 2px; }
.cp-sheet-head h2 .deal { vertical-align: 3px; }
@media (max-width: 720px) { .cp-intro { grid-template-columns: 1fr; gap: 16px; } .cp-intro .btn { justify-self: start; } }

.cp-tabsrow {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 24px;
  border-bottom: 1px solid var(--line);
}
/* The strip scrolls sideways only. It sits on the row's rule by its own
   -1px margin: the same margin on each tab overflowed it by a pixel, and
   iOS then scrolled it both ways. */
.cp-tabs { position: relative; display: flex; gap: 26px; margin-bottom: -1px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
.cp-tabs::-webkit-scrollbar { display: none; }
/* The underline is one bar that slides to the tab (commonplace.js); without
   the script, the current tab keeps its own border. */
.cp-tabbar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; border-radius: 2px; background: var(--ink); }
.cp-tabs.has-bar a[aria-current="page"] { border-color: transparent; }
.cp-tabs a { transition: color 0.25s ease; }
.cp-tabs a {
  padding: 0 0 12px;
  border-bottom: 2px solid transparent;
  font: 600 15px/1 var(--sans);
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}
.cp-tabs a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
/* The week strip: a glass pill with this week's count and a
   countdown to Monday whose ring drains as the week runs out. */
.cp-week {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  font: 500 13.5px/1 var(--sans);
  color: var(--ink-2);
  white-space: nowrap;
}
.cp-week b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.cp-wsep { width: 1px; height: 14px; background: var(--line); }
.cp-reset { gap: 7px; text-decoration: none; }
.cp-ring { width: 16px; height: 16px; transform: rotate(-90deg); }
.cp-ring circle { fill: none; stroke-width: 2.4; }
.cp-ring-track { stroke: color-mix(in srgb, var(--ink) 14%, transparent); }
.cp-ring-left { stroke: var(--ink); stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
@media (max-width: 560px) {
  .cp-tabsrow { flex-direction: column-reverse; align-items: flex-start; gap: 12px; }
  /* on a phone the strip runs to the screen's edges, so the last tab
     scrolls in from the edge rather than stopping at the margin */
  .cp-tabs { gap: 18px; width: calc(100% + 2 * var(--gutter)); max-width: none; margin: 0 calc(-1 * var(--gutter)) -1px; padding: 0 var(--gutter); scroll-padding-inline: var(--gutter); }
  .cp-week { margin-bottom: 0; }
}
/* beside the pill the tabs sit on the row's rule, as their underline should */
@media (min-width: 561px) { .cp-tabs { align-self: flex-end; } }
/* the narrowest phones keep the ring and the time; "Resets in" stays for
   screen readers */
@media (max-width: 359px) { .cp-reset-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }

/* ---------- tooltips ----------
   A dotted line of text (or an info glyph) that explains itself on hover,
   keyboard focus or a tap, in a glass bubble above it. */
.cp-tipwrap { position: relative; display: inline-flex; }
.cp-tipbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: help;
  text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 4px;
}
.cp-i { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cp-tip {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: min(290px, calc(100vw - 24px));
  padding: 10px 13px;
  border-radius: 14px;
  font: 400 13.5px/1.45 var(--sans);
  color: var(--ink);
  text-align: left;
  white-space: normal;
  /* closed, it takes no room at all: a hidden bubble past the screen's
     edge would still widen the page on a phone */
  display: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(-50% + var(--dx, 0px)), 6px) scale(0.97);
  transform-origin: 50% 100%;
  transition: opacity 0.16s ease, transform 0.24s cubic-bezier(0.2, 0.85, 0.25, 1), display 0.24s allow-discrete;
}
.cp-tipwrap:hover .cp-tip, .cp-tipbtn:focus-visible + .cp-tip, .cp-tipwrap.open .cp-tip {
  display: block;
  opacity: 1;
  transform: translate(calc(-50% + var(--dx, 0px)), 0) scale(1);
}
/* A bubble must read over anything, so its glass is nearly solid: the rim
   and shadow stay, the see-through goes. */
.cp-tip.glass { background: color-mix(in srgb, var(--paper) 94%, transparent); }
:root[data-theme="dark"] .cp-tip.glass { background: rgba(40, 40, 40, 0.96); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cp-tip.glass { background: rgba(40, 40, 40, 0.96); }
}
@starting-style {
  .cp-tipwrap:hover .cp-tip, .cp-tipbtn:focus-visible + .cp-tip, .cp-tipwrap.open .cp-tip {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), 6px) scale(0.97);
  }
}

.cp-empty { color: var(--ink-2); margin: 0 0 18px; }

/* ---------- the grid ---------- */

.cp-grid {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  padding-bottom: 28px;
}

@media (max-width: 760px) { .cp-grid { grid-template-columns: 1fr; } }
/* A tab switch swaps the grid in place; the old cards dim while the new
   tab loads, so the tap reads at once. */
.cp-grid { transition: opacity 0.15s ease; }
.cp-grid[aria-busy="true"] { opacity: 0.45; }
.cp-next { display: flex; width: max-content; margin: 8px auto calc(var(--block) * 0.6); }
.cp > .wrap { padding-bottom: calc(var(--block) * 0.4); }

/* ---------- the card ---------- */

/* The wall's glass: the site's .glass (site.css) rim and shadows, with the
   fill that glass shows over a flat page, and no live blur. The page behind
   the wall is flat, so a backdrop-filter would blur nothing while costing
   every visible card a re-blur on every scrolled frame. The solid fill also
   keeps cards clean where they cross during the tab glide. Off-screen cards
   skip rendering (content-visibility), so a long wall scrolls as lightly as
   a short one. An open menu lifts its card over the next one. */
.cp-grid .glass, .cp-week.glass {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: linear-gradient(to bottom, color-mix(in srgb, #ffffff 30%, var(--paper)), var(--paper));
}
:root[data-theme="dark"] .cp-grid .glass, :root[data-theme="dark"] .cp-week.glass {
  background: linear-gradient(to bottom, color-mix(in srgb, #ffffff 7%, var(--paper)), color-mix(in srgb, #ffffff 4%, var(--paper)));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cp-grid .glass, :root:not([data-theme="light"]) .cp-week.glass {
    background: linear-gradient(to bottom, color-mix(in srgb, #ffffff 7%, var(--paper)), color-mix(in srgb, #ffffff 4%, var(--paper)));
  }
}
/* the placeholder is the content box: 227px less the 30px of padding */
.cp-grid > .cp-card { content-visibility: auto; contain-intrinsic-size: auto 197px; }
.cp-card {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  padding: 16px 18px 14px;
  min-width: 0;
  /* the card's own width decides what its row of pills holds */
  container: cp-card / inline-size;
  transition: opacity 0.35s ease, filter 0.35s ease;
}
.cp-card:has(.cp-menu) { z-index: 6; }
.cp-card.down { opacity: 0.55; filter: saturate(0.6); }
.cp-card.hl-yellow { --marker: var(--hl-yellow); --fill: #ffd60a; --on: #111; }
.cp-card.hl-orange { --marker: var(--hl-orange); --fill: #ff9f0a; --on: #111; }
.cp-card.hl-green { --marker: var(--hl-green); --fill: #30d158; --on: #111; }
.cp-card.hl-blue { --marker: var(--hl-blue); --fill: #0a84ff; --on: #fff; }
.cp-card.hl-pink { --marker: var(--hl-pink); --fill: #ff375f; --on: #fff; }
.cp-card.hl-purple { --marker: var(--hl-purple); --fill: #bf5af2; --on: #fff; }

.cp-head {
  display: grid;
  grid-template-columns: 22px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  height: 54px;
}
.cp-head:not(:has(.cp-rank)) { grid-template-columns: 36px minmax(0, 1fr) auto; }
.cp-rank { font: 700 20px/1 var(--sans); text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cp-cover {
  display: block;
  width: 36px;
  height: 54px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}
.cp-cover-none { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.cp-names { min-width: 0; }
.cp-t, .cp-m { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-t { font: 600 16px/1.2 var(--sans); }
.cp-t a { color: inherit; text-decoration: none; }
.cp-t a:hover { text-decoration: underline; text-underline-offset: 2px; }
.cp-t span { font-weight: 400; color: var(--ink-2); }
.cp-m { margin-top: 3px; font: 13px/1.3 var(--sans); color: var(--ink-3); }
/* The meta line is a row, so the avatar centres on the text; the text keeps
   its own ellipsis. */
.cp-m { display: flex; align-items: center; min-width: 0; }
/* The meta strip, as in the app: each field is its glyph and its value,
   with no separators. The name gives way first; the page and day stay. */
.cp-mt { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.cp-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--ink-2); }
.cp-mf { display: inline-flex; align-items: center; gap: 3px; flex: none; font-variant-numeric: tabular-nums; }
.cp-mi { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* Generic avatars: a reading glyph on its own highlighter tint, mixed with
   the page, so both schemes get a soft disc and a legible glyph. */
.cp-av {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hue) 28%, var(--paper));
  color: color-mix(in srgb, var(--hue) 72%, var(--ink));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue) 30%, transparent);
}
.cp-av svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.av-0 { --hue: #ffb800; }
.av-1 { --hue: #30d158; }
.av-2 { --hue: #ff375f; }
.av-3 { --hue: #0a84ff; }
.av-4 { --hue: #ff9f0a; }
.av-5 { --hue: #bf5af2; }
.cp-av-ini { font: 700 10px/1 var(--sans); letter-spacing: 0; }

/* the sheet's avatar picker: the twelve icons and the initial, as swatches */
.cp-avatars { min-width: 0; margin: 0; padding: 0; border: 0; }
/* one line: all thirteen fit in the sheet; on a phone the row scrolls */
.cp-avrow { display: flex; gap: 5px; margin: -4px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.cp-avrow::-webkit-scrollbar { display: none; }
.cp-avatars legend { padding: 0 0 6px; font: 600 13px/1.2 var(--sans); color: var(--ink-2); }
.cp-avatars legend small { font-weight: 400; color: var(--ink-3); }
.cp-avpick { position: relative; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.cp-avpick input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.cp-avpick .cp-av { pointer-events: none; width: 28px; height: 28px; margin: 0; transition: transform 0.2s cubic-bezier(0.2, 0.85, 0.25, 1); }
.cp-avpick .cp-av svg { width: 16px; height: 16px; }
.cp-avpick .cp-av-ini { font-size: 13px; }
.cp-avpick:hover .cp-av { transform: scale(1.08); }
.cp-avpick:has(input:checked) { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.cp-avpick:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 4px; }
.cp-dots {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.cp-dots:hover { background: var(--cp-pill); }
.cp-dots svg { width: 16px; height: 16px; fill: currentColor; }

/* Three lines of room, always: a shorter line leaves space, a longer one
   is clamped and Read more appears over the end of the third line. */
.cp-qbox { position: relative; margin-top: 14px; }
.cp-quote {
  margin: 0;
  font: 18px/1.5 var(--serif);
  height: 4.5em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.cp-card.open .cp-quote { height: auto; display: block; -webkit-line-clamp: unset; }
/* The highlighter is the upvote: it draws across the line, left to right. */
.cp-quote mark {
  color: inherit;
  padding: 2px 3px;
  margin: -2px -3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 0 / 0% 100%;
  transition: background-size 0.7s ease-in-out;
}
.cp-card.up .cp-quote mark { background-size: 100% 100%; }
.cp-readmore {
  display: none;
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0 0 0 40px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--cp-card) 36px);
  font: 600 14px/27px var(--sans);
  color: var(--blue);
  cursor: pointer;
}
.cp-card.clamped:not(.open) .cp-readmore { display: block; }
/* a spoiler, as on Letterboxd: a quiet panel with an icon where the quote
   would be; a tap lifts it and the words rise in (commonplace.js) */
.cp-qbox.is-spoiler:not(.is-shown) .cp-quote, .cp-qbox.is-spoiler:not(.is-shown) .cp-readmore { visibility: hidden; }
.cp-spoiler {
  position: absolute;
  inset: -4px -6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px;
  border: 0;
  border-radius: 14px;
  background: var(--cp-pill);
  color: var(--ink-3);
  font: 500 14px/1.3 var(--sans);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cp-spoiler:hover { color: var(--ink-2); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.cp-spoiler:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.cp-spoiler-i { flex: none; width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cp-spoiler[hidden] { display: none; }
.cp-w { display: inline-block; }

.cp-acts { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 14px; }
.cp-pill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--cp-pill);
  color: var(--ink-2);
  font: 600 13px/1 var(--sans);
  white-space: nowrap;
  flex: 0 0 auto;
}
.cp-pill svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cp-share, .cp-save { gap: 6px; padding: 0 14px 0 11px; cursor: pointer; }
/* a narrow card (a phone, the two-column tablet) gives the mood its room:
   Share moves into the card's ... menu (commonplace.js) */
@container cp-card (max-width: 400px) { .cp-share { display: none; } }
/* the readers' mood: the leading valence's glyph in its colour, the top
   emotions, how many; tinted with your valence once you have given one */
.cp-mood { gap: 6px; min-width: 0; padding: 0 13px 0 10px; flex: 0 1 auto; color: var(--ink-2); cursor: pointer; transition: background-color 0.25s ease, color 0.25s ease; }
.cp-mood:hover { color: var(--ink); }
.cp-mood .cp-mg { flex: none; color: var(--mv, currentColor); stroke-width: 2.6; }
.cp-mood.is-empty .cp-mg { stroke-width: 2; }
.cp-mood-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cp-mood-n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cp-mood.is-mine { background: color-mix(in srgb, var(--mv, var(--blue)) 20%, var(--cp-pill)); color: var(--ink); }
.cp-share:hover, .cp-save:hover { color: var(--ink); }
.cp-vote { padding: 0 2px; transition: background-color 0.25s ease, color 0.25s ease; }
.cp-vote button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.6, 0.64, 1), background-color 0.2s ease;
}
.cp-vote button svg { stroke-width: 2.3; }
.cp-vote button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.cp-vote button:active { transform: scale(0.84); }
.cp-n { min-width: 2.6ch; padding: 0 2px; text-align: center; color: var(--ink); font-variant-numeric: tabular-nums; }
.cp-card.up .cp-vote { background: var(--fill); color: var(--on); }
.cp-card.up .cp-vote .cp-n { color: var(--on); }
.cp-card.down .cp-vote { background: var(--ink-3); color: var(--paper); }
.cp-card.down .cp-vote .cp-n { color: var(--paper); }
.cp-save .cp-ck { display: none; }
.cp-save.on { color: var(--ink); }
.cp-save.on .cp-bm { display: none; }
.cp-save.on .cp-ck { display: block; color: var(--blue); stroke-width: 2.6; }

/* The "…" menu: Copy Link, Report. */
.cp-menu {
  position: absolute;
  z-index: 5;
  right: 0;
  top: 34px;
  min-width: 170px;
  padding: 6px;
  border-radius: 14px;
  background: var(--cp-card);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px rgba(0, 0, 0, 0.35);
}
.cp-menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font: 500 14px/1.2 var(--sans);
  text-align: left;
  cursor: pointer;
}
.cp-menu button:hover { background: var(--cp-pill); }
.cp-menu .cp-report { color: #e5484d; }

/* ---------- the offer: one cell of the grid, the size of a card ---------- */

/* As tall as a card even alone in a one-column row: the card's padding
   (16 + 14), header (54), gaps (14 + 14), three lines of 18px at 1.5 (81)
   and the pill row (34). */
/* The offer is glass too, tinted with the yellow highlighter. */
.cp-offer {
  min-height: 227px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  border-radius: 18px;
  padding: 16px 20px;
}
.cp-grid .cp-offer.glass { background: linear-gradient(160deg, color-mix(in srgb, #ffd60a 34%, var(--paper)), color-mix(in srgb, #ffd60a 14%, var(--paper))); }
:root[data-theme="dark"] .cp-grid .cp-offer.glass { background: linear-gradient(160deg, color-mix(in srgb, #ffd60a 22%, var(--paper)), color-mix(in srgb, #ffd60a 8%, var(--paper))); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cp-grid .cp-offer.glass { background: linear-gradient(160deg, color-mix(in srgb, #ffd60a 22%, var(--paper)), color-mix(in srgb, #ffd60a 8%, var(--paper))); }
}
.cp-tag { align-self: flex-start; padding: 6px 9px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 700 12px/1 var(--sans); }
.cp-offer h2 { margin: 0 0 4px; font: 700 21px/1.15 var(--sans); letter-spacing: -0.015em; }
.cp-offer p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
/* the label stays one line beside its icon (a button centres wrapped text);
   when the row is too narrow for both, the button takes its own line */
.cp-offer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.cp-offer .cp-tipbtn { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; text-align: left; }

/* the download card: the offer card's frame, tinted with the page's blue,
   the app's icon beside the heading so it keeps a card's height */
.cp-app { min-height: 227px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; border-radius: 18px; padding: 16px 20px; }
.cp-grid .cp-app.glass { background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 14%, var(--paper)), color-mix(in srgb, var(--blue) 5%, var(--paper))); }
:root[data-theme="dark"] .cp-grid .cp-app.glass { background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 20%, var(--paper)), color-mix(in srgb, var(--blue) 7%, var(--paper))); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cp-grid .cp-app.glass { background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 20%, var(--paper)), color-mix(in srgb, var(--blue) 7%, var(--paper))); }
}
.cp-app-head { display: flex; align-items: center; gap: 14px; }
.cp-app-icon { flex: none; width: 52px; height: 52px; border-radius: 12px; }
.cp-app-dark { display: none; }
:root[data-theme="dark"] .cp-app-light { display: none; }
:root[data-theme="dark"] .cp-app-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cp-app-light { display: none; }
  :root:not([data-theme="light"]) .cp-app-dark { display: block; }
}
.cp-app h2 { margin: 0; font: 700 21px/1.15 var(--sans); letter-spacing: -0.015em; }
.cp-app p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
.cp-get { align-self: flex-start; }

/* ---------- the submit sheet ---------- */

.cp-sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
}
/* The sheet's motion (commonplace.js sets the classes and --i). In: the
   backdrop fades, the sheet rises on a spring, and the fields follow 35ms
   apart. Out: a short drop and a fade, no stagger. */
.cp-sheet { opacity: 0; transform: translateY(28px) scale(0.965); }
.cp-sheet.is-in { opacity: 1; transform: none; transition: opacity 0.26s ease, transform 0.52s cubic-bezier(0.2, 0.9, 0.25, 1.1); }
.cp-sheet.is-leaving { opacity: 0; transform: translateY(14px) scale(0.985); transition: opacity 0.22s ease, transform 0.26s ease-in; }
.cp-sheet::backdrop { background: rgba(0, 0, 0, 0.42); opacity: 0; transition: opacity 0.3s ease; }
.cp-sheet.is-in::backdrop { opacity: 1; }
.cp-sheet .cp-form > *, .cp-sheet .cp-done > * { opacity: 0; transform: translateY(10px); }
.cp-sheet.is-in .cp-form > *, .cp-sheet.is-in .cp-done > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s ease calc(0.1s + var(--i, 0) * 0.035s), transform 0.46s cubic-bezier(0.2, 0.85, 0.25, 1) calc(0.1s + var(--i, 0) * 0.035s);
}
.cp-sheet.is-leaving .cp-form > *, .cp-sheet.is-leaving .cp-done > * { opacity: 1; transform: none; transition: none; }
/* after sending, the thank-you rises in its own stagger */
.cp-sheet.is-in .cp-done:not([hidden]) > * { animation: cp-rise 0.46s cubic-bezier(0.2, 0.85, 0.25, 1) calc(var(--i, 0) * 0.05s) backwards; }
@keyframes cp-rise { from { opacity: 0; transform: translateY(10px); } }
.cp-sheet h2 { white-space: nowrap; }
.cp-form, .cp-done { display: grid; gap: 14px; padding: 20px 22px 22px; }
.cp-done[hidden], .cp-form[hidden] { display: none; }
.cp-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.cp-sheet h2 { margin: 0; font: 700 22px/1.2 var(--sans); letter-spacing: -0.015em; }
.cp-close { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--cp-pill); color: var(--ink-2); cursor: pointer; }
.cp-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.cp-done .cp-close { width: auto; height: auto; border-radius: 999px; background: var(--button); color: var(--button-ink); justify-self: start; }
.cp-field { display: grid; gap: 6px; font: 600 13px/1.2 var(--sans); color: var(--ink-2); }
.cp-field[hidden] { display: none; }
/* a yes or no in the sheet: the system checkbox in the page's blue */
.cp-checkrow { display: flex; align-items: flex-start; gap: 10px; font: 14px/1.35 var(--sans); color: var(--ink); cursor: pointer; }
.cp-checkrow input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); cursor: pointer; }
.cp-checkrow b { display: block; font-weight: 600; }
.cp-checkrow small { color: var(--ink-3); font-size: 13px; }
.cp-field input, .cp-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cp-card);
  color: var(--ink);
  font: 400 16px/1.4 var(--sans);
}
.cp-field textarea { font: 18px/1.5 var(--serif); resize: vertical; min-height: 6.5em; }
.cp-field input:focus, .cp-field textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.cp-field small { font-weight: 400; color: var(--ink-3); }
.cp-count { justify-self: end; font-weight: 500; color: var(--ink-3); }
.cp-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: end; }
.cp-swatches { display: flex; gap: 10px; margin: 0; padding: 0; border: 0; }
.cp-swatches legend { padding: 0 0 6px; font: 600 13px/1.2 var(--sans); color: var(--ink-2); }
.cp-swatch { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--solid); cursor: pointer; }
.cp-swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cp-swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.cp-swatch:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 4px; }
.cp-swatch.hl-yellow { --solid: #ffd60a; }
.cp-swatch.hl-green { --solid: #30d158; }
.cp-swatch.hl-pink { --solid: #ff375f; }
.cp-swatch.hl-blue { --solid: #0a84ff; }
.cp-swatch.hl-orange { --solid: #ff9f0a; }
.cp-swatch.hl-purple { --solid: #bf5af2; }
.cp-results { display: grid; gap: 4px; max-height: 300px; overflow-y: auto; }
.cp-results:empty { display: none; }
.cp-result, .cp-chosen {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  font: 14px/1.3 var(--sans);
  text-align: left;
}
.cp-result { cursor: pointer; }
.cp-result:hover, .cp-result:focus-visible { background: var(--cp-pill); }
.cp-result img, .cp-chosen img, .cp-result .cp-cover-none, .cp-chosen .cp-cover-none { width: 28px; height: 42px; border-radius: 3px; object-fit: cover; }
.cp-result b, .cp-chosen b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-result small, .cp-chosen small { color: var(--ink-3); }
.cp-chosen { background: var(--cp-pill); }
.cp-chosen[hidden] { display: none; }
/* the chosen book: its cover beside the title, and two pill buttons under
   it, the shape of Add, tinted so Add stays the main action */
.cp-chosen { grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 10px; padding: 12px; }
.cp-chosen > img, .cp-chosen > .cp-cover-none { grid-row: span 2; width: 44px; height: 66px; border-radius: 5px; }
.cp-chosen-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.cp-tinted { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }

/* Change Cover: the app's Change Cover grid, as a step inside the sheet
   (Monarch's in-dialog picker): back, title and close; the search, seeded
   with the book; four columns of 2:3 covers that pop in 35ms apart. */
.cp-covers { display: grid; gap: 14px; padding: 20px 22px 22px; }
.cp-covers[hidden] { display: none; }
.cp-covers .cp-sheet-head { justify-content: flex-start; gap: 4px; }
.cp-covers .cp-close { margin-left: auto; }
.cp-back { display: grid; place-items: center; width: 34px; height: 34px; margin-left: -9px; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.cp-back:hover, .cp-back:focus-visible { background: var(--cp-pill); }
.cp-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cp-cgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 8px;
  align-content: start;
  height: min(52dvh, 460px);
  margin: -4px;
  padding: 4px;
  overflow-y: auto;
  scrollbar-width: none;
}
.cp-cgrid::-webkit-scrollbar { display: none; }
.cp-ctile {
  position: relative;
  display: block;
  width: 100%;
  /* 2:3 from the width. With aspect-ratio the rows ignored the tiles'
     height and shared the grid's own height, so the tiles overlapped. */
  height: 0;
  padding: 0 0 150%;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cp-pill);
  box-shadow: 0 0 0 0.5px var(--line), 0 6px 14px -8px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.cp-ctile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s ease; }
.cp-ctile.is-loaded img { opacity: 1; }
/* the shared shimmer while a cover loads, as the app's SkeletonBlock */
.cp-ctile:not(.is-loaded)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.16) 50%, transparent 70%) 0 0 / 250% 100%;
  animation: cp-shimmer 1.3s linear infinite;
}
@keyframes cp-shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.cp-ctile:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* the cover in use: a ring and a check in primary ink */
.cp-ctile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2.5px var(--ink); opacity: 0; transition: opacity 0.2s ease; }
.cp-ctile[aria-selected="true"]::after { opacity: 1; }
.cp-check { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--paper); opacity: 0; transform: scale(0.4); transition: opacity 0.18s ease, transform 0.36s cubic-bezier(0.34, 1.5, 0.64, 1); }
.cp-check svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cp-ctile[aria-selected="true"] .cp-check { opacity: 1; transform: none; }
.cp-cnote { margin: 0; color: var(--ink-2); font-size: 14px; }
@media (max-width: 400px) { .cp-cgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cp-results p { margin: 6px 2px; color: var(--ink-2); font-size: 14px; }
/* a search row's cover shimmers until it loads (commonplace.js pops it in) */
.cp-rcover { position: relative; display: block; width: 28px; height: 42px; border-radius: 3px; overflow: hidden; background: var(--cp-pill); }
.cp-rcover img { display: block; opacity: 0; }
.cp-result.is-loaded .cp-rcover img { opacity: 1; }
.cp-result:not(.is-loaded) .cp-rcover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.16) 50%, transparent 70%) 0 0 / 250% 100%;
  animation: cp-shimmer 1.3s linear infinite;
}
.cp-fine { margin: 0; color: var(--ink-3); font-size: 13px; }
.cp-error { margin: 0; color: #e5484d; font-size: 14px; }
.cp-send { justify-self: start; }
.cp-send[disabled] { opacity: 0.6; }
@media (max-width: 760px) {
  .cp-sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  /* a phone's sheet comes up from the bottom edge and goes back down */
  .cp-sheet { opacity: 1; transform: translateY(100%); }
  .cp-sheet.is-in { transform: none; transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.25, 1); }
  .cp-sheet.is-leaving { opacity: 1; transform: translateY(100%); transition: transform 0.28s ease-in; }
  /* the Your Mood sheet is short: pinned to the bottom edge only (pinned to
     all four, auto height stretches it to the full screen), as tall as it needs */
  .cp-moodsheet { inset: auto 0 0; width: 100vw; height: auto; max-height: calc(100dvh - 48px); margin: 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .cp-row { grid-template-columns: 1fr; }
}

/* ---------- the quote page ---------- */

.cp-quote-page { padding: calc(var(--nav-h) + 56px) 0 var(--block); }
.cp-quote-page .wrap { max-width: 680px; }
.cp-quote-page .cp-quote { height: auto; display: block; -webkit-line-clamp: unset; font-size: 24px; }
.cp-quote-page .cp-quote mark { background-size: 100% 100%; }
.cp-store { display: grid; justify-items: start; gap: 14px; margin-top: 34px; }
.cp-store p { margin: 0; color: var(--ink-2); font-size: 18px; }
.cp-seewall { color: var(--ink-2); font-size: 15px; }
/* the box here is as tall as its quote, so a one-line spoiler keeps room
   for the panel's icon and words until it is shown */
.cp-quote-page .cp-qbox.is-spoiler { transition: min-height 0.3s ease; }
.cp-quote-page .cp-qbox.is-spoiler:not(.is-shown) { min-height: 96px; }

/* ---------- the review page (one reader: Trevor) ---------- */

.rv-page { background: var(--paper); }
.rv { max-width: 1080px; margin: 0 auto; padding: 44px var(--gutter) 110px; }
.rv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 26px; }
.rv-head h1 { margin: 0 auto 0 0; font: 700 34px/1.1 var(--sans); letter-spacing: -0.02em; }
.rv-up { flex-basis: 100%; margin-bottom: -6px; color: var(--blue); font: 600 14px/1 var(--sans); text-decoration: none; }
.rv-up::before { content: "‹ "; }
.rv-up:hover { text-decoration: underline; }
/* the code stock, as a pill like the wall's week strip; red when low */
.rv-stock { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--cp-pill); color: var(--ink-2); font: 500 13.5px/1 var(--sans); }
.rv-stock b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.rv-stock.low, .rv-stock.low b { background: color-mix(in srgb, #e5484d 14%, transparent); color: #e5484d; }
.rv-stock.low b { background: none; }
.rv-open { color: var(--blue); font: 600 14px/1 var(--sans); text-decoration: none; }
.rv-open:hover { text-decoration: underline; }

/* the two queues, as tabs with counts (Circle's moderation inbox) */
.rv-tabs { position: relative; display: flex; gap: 26px; border-bottom: 1px solid var(--line); }
.rv-tab { display: inline-flex; align-items: center; gap: 8px; padding: 0 0 12px; border: 0; background: none; color: var(--ink-3); font: 600 15px/1 var(--sans); cursor: pointer; transition: color 0.25s ease; }
.rv-tab[aria-selected="true"] { color: var(--ink); }
.rv-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
.rv-n { min-width: 22px; padding: 4px 7px; border-radius: 999px; background: var(--cp-pill); color: var(--ink-2); font: 650 12px/1 var(--sans); font-variant-numeric: tabular-nums; text-align: center; transition: background-color 0.25s ease, color 0.25s ease; }
.rv-n:empty { display: none; }
.rv-tab[aria-selected="true"] .rv-n { background: var(--ink); color: var(--paper); }
.rv-tabbar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; border-radius: 2px; background: var(--ink); }
.rv-list[hidden] { display: none; }

/* one quote: its card as readers will see it, beside the edits */
.rv-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; padding: 30px 0; border-bottom: 1px solid var(--line); }
.rv-preview { position: sticky; top: 24px; }
.rv-preview .cp-quote { height: auto; display: block; -webkit-line-clamp: unset; }
.rv-preview .cp-quote mark { background-size: 100% 100%; }
.rv-preview .cp-readmore { display: none; }
/* the reviewer reads every quote, spoiler or not */
.rv-preview .cp-qbox.is-spoiler .cp-quote { visibility: visible; }
.rv-preview .cp-spoiler { display: none; }
.rv-side { display: grid; gap: 14px; min-width: 0; }
.rv-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--ink-3); font: 13px/1.3 var(--sans); }
.rv-fact { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.rv-fact svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rv-badge { padding: 5px 9px; border-radius: 999px; background: var(--cp-pill); color: var(--ink-2); font: 600 12px/1 var(--sans); }
.rv-badge.warn { background: color-mix(in srgb, #e5484d 14%, transparent); color: #e5484d; }
/* Claude's reason for a quote it held or put up */
.rv-claude { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--cp-pill); color: var(--ink-2); font: 14px/1.4 var(--sans); }
.rv-claude b { color: var(--ink); font-weight: 600; }
.rv-bookfield input[type="search"] { margin-top: 8px; }
.rv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; }
.rv-actions .btn { padding: 12px 22px; font-size: 15px; }
.rv-actions .btn[disabled] { opacity: 0.55; pointer-events: none; }
.rv-reject { background: color-mix(in srgb, #e5484d 14%, transparent); color: #e5484d; }
.rv-more { display: block; margin: 28px auto 0; }
.rv-empty { padding: 72px 0; text-align: center; color: var(--ink-2); }
.rv-empty h2 { margin: 0 0 6px; color: var(--ink); font: 700 21px/1.2 var(--sans); }
.rv-empty p { margin: 0; font-size: 15px; }
@media (max-width: 860px) {
  .rv-item { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .rv-preview { position: static; }
}

/* what a decision did, in the app's blue toast */
.rv-toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; max-width: calc(100vw - 32px); padding: 13px 20px; border-radius: 999px; background: var(--blue); color: #fff; font: 600 14px/1.3 var(--sans); box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.45); transform: translateX(-50%); }
.rv-toast[hidden] { display: none; }

/* Reject and Unpublish ask first, in a dialog in the sheet's style */
.rv-dialog { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); }
.rv-dialog::backdrop { background: rgba(0, 0, 0, 0.42); }
.rv-dialog h2 { margin: 0 0 6px; font: 700 20px/1.2 var(--sans); letter-spacing: -0.01em; }
.rv-dialog p { margin: 0 0 20px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.rv-dialog-acts { display: flex; justify-content: flex-end; gap: 10px; }
.rv-dialog .btn { padding: 11px 20px; font-size: 15px; }
.rv-danger { background: #e5484d; color: #fff; }

/* ---------- Reduce Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cp-sheet, .cp-sheet.is-in, .cp-sheet.is-leaving,
  .cp-sheet .cp-form > *, .cp-sheet .cp-done > * { transform: none !important; transition: opacity 0.15s ease !important; animation: none !important; }
  .cp-tip { transition: opacity 0.12s ease; }
  .cp-ctile:not(.is-loaded)::before, .cp-result:not(.is-loaded) .cp-rcover::before { animation: none; }
  .cp-check { transition: opacity 0.15s ease; transform: none; }
}

/* ---------- moods ---------- */
/* The app's five valence colours (MoodValence.color). Purple and blue are
   lifted on dark paper, where the app's own fall under 3:1. */
:root {
  --mv-veryUnpleasant: rgb(80 52 196);
  --mv-unpleasant: rgb(19 79 209);
  --mv-neutral: rgb(75 164 187);
  --mv-pleasant: rgb(211 171 21);
  --mv-veryPleasant: rgb(254 128 65);
}
:root[data-theme="dark"] { --mv-veryUnpleasant: rgb(146 124 246); --mv-unpleasant: rgb(84 146 255); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --mv-veryUnpleasant: rgb(146 124 246); --mv-unpleasant: rgb(84 146 255); }
}
.mv-veryUnpleasant, .cp-moodf[data-v="veryUnpleasant"] { --mv: var(--mv-veryUnpleasant); }
.mv-unpleasant, .cp-moodf[data-v="unpleasant"] { --mv: var(--mv-unpleasant); }
.mv-neutral, .cp-moodf[data-v="neutral"] { --mv: var(--mv-neutral); }
.mv-pleasant, .cp-moodf[data-v="pleasant"] { --mv: var(--mv-pleasant); }
.mv-veryPleasant, .cp-moodf[data-v="veryPleasant"] { --mv: var(--mv-veryPleasant); }

/* The mood field: valence swatches as the Highlighter's (30px, the same
   ring when picked), the glyph inside in white or ink, whichever reads on
   the colour; the chosen name beside them; the emotions as card pills. */
.cp-moodf { display: grid; gap: 12px; }
.cp-moodf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: 34px; }
.cp-moodf-vals { display: flex; gap: 10px; }
.cp-mv {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--mv);
  color: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}
.cp-mv.mv-veryUnpleasant, .cp-mv.mv-unpleasant { color: #fff; }
:root[data-theme="dark"] .cp-mv.mv-veryUnpleasant, :root[data-theme="dark"] .cp-mv.mv-unpleasant { color: rgba(0, 0, 0, 0.72); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cp-mv.mv-veryUnpleasant, :root:not([data-theme="light"]) .cp-mv.mv-unpleasant { color: rgba(0, 0, 0, 0.72); }
}
.cp-mv svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cp-mv[aria-checked="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.cp-mv:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.cp-moodf-name { font: 600 13px/1.2 var(--sans); color: var(--ink-2); }
.cp-moodf-emos { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px; padding: 2px; overflow: hidden; }
.cp-moodf-emos[hidden], .cp-emo[hidden] { display: none; }
.cp-emo { padding: 0 13px; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; }
.cp-emo:hover { color: var(--ink); }
.cp-emo[aria-pressed="true"] { background: color-mix(in srgb, var(--mv) 26%, var(--cp-pill)); color: var(--ink); }
.cp-emo:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* the Your Mood sheet: the Add sheet, smaller */
@media (min-width: 761px) { .cp-moodsheet { width: min(460px, calc(100vw - 32px)); } }
.cp-moodbook { grid-template-columns: 36px minmax(0, 1fr); padding: 10px 12px; }
.cp-moodbook > img, .cp-moodbook > .cp-cover-none { grid-row: auto; width: 36px; height: 54px; border-radius: 4px; }
.cp-moodacts { display: flex; flex-wrap: wrap; gap: 10px; }
.cp-mood-remove[hidden] { display: none; }

/* ---------- the admin page (src/admin.js; one reader: Trevor). Never an
   ad- class: ad blockers hide ad-tile, ad-grid and ad-row ---------- */

.hub-sec { margin-bottom: 40px; }
.hub-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 14px; }
.hub-sec-head h2 { margin: 0 auto 0 0; font: 650 21px/1.2 var(--sans); letter-spacing: -0.01em; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; }
/* languages three to a row (two on a phone): six across wrapped
   "Portuguese (Brazil)" and dropped its number below the others */
.hub-langs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
@media (max-width: 640px) { .hub-langs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hub-tile, .hub-lang, .hub-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--cp-card);
  box-shadow: var(--cp-card-shadow);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.hub-tile:hover, .hub-lang:hover, .hub-row:hover { background: color-mix(in srgb, var(--cp-card) 94%, var(--ink)); }
.hub-tile:active, .hub-lang:active, .hub-row:active { transform: scale(0.985); }
.hub-tile:focus-visible, .hub-lang:focus-visible, .hub-row:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.hub-num { font: 700 34px/1 var(--sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hub-label { color: var(--ink-2); font: 500 14px/1.3 var(--sans); }
.has .hub-num { color: var(--blue); }
.low .hub-num { color: #e5484d; }
.hub-lang h3 { margin: 0 0 4px; color: var(--ink-2); font: 600 14px/1.2 var(--sans); }
.hub-facts { color: var(--ink-3); font: 500 13px/1.35 var(--sans); }
.hub-row { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-top: 12px; }
.hub-row b { font: 600 15px/1.3 var(--sans); }
.hub-row span { color: var(--ink-3); font: 500 13px/1.35 var(--sans); }
