/* Plot45 — Report (E3a) · the lab-report writer room.
   Unified chrome (light header · ink rail · paper work area). The document is
   an always-light paper page — like the Sketch canvas, so on-screen matches
   print in either theme. Broadsheet typography carries the print quality. */

/* STIX Two Math (OFL) — vendored like the Supabase SDK: Chromium cannot
   stretch radicals/brackets without an OpenType MATH font, and Linux/ChromeOS
   machines rarely ship one (Windows has Cambria Math, Apple ships STIX).
   Loaded only in the Write room; system math fonts win when present. */
@font-face {
  font-family: "STIX Two Math";
  src: url("/assets/fonts/STIXTwoMath-Regular.woff2") format("woff2");
  font-display: swap;
}
math {
  font-family: "Latin Modern Math", "Cambria Math", "STIX Two Math", math;
}

:root {
  --rp-paper: #ffffff;
  --rp-ink: #1a1a1a;
  --rp-muted-ink: #5b6166;
}

/* layout: header (56) + [ink rail][page area] */
.rp-app {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  height: calc(100vh - var(--nav-height, 56px));
  min-height: 0;
  background: var(--bg-subtle);
}

/* the page area: toolbar + scrolling paper */
.rp-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.rp-toolbar {
  display: flex; align-items: center; gap: 14px; height: 46px; flex: none;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line-strong);
}
.rp-toolbar__group { display: flex; align-items: center; gap: 3px; }
/* hairline dividers between tool categories (review R4); the spring before
   the file actions breaks the sibling chain, so they stay divider-free */
.rp-toolbar__group + .rp-toolbar__group {
  border-left: 1px solid var(--line-strong);
  padding-left: 14px;
}
.rp-toolbar__spring { margin-left: auto; }
.rp-tbtn {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius);
  background: none; color: var(--text); font: inherit; font-size: 13px;
  font-weight: 650; cursor: pointer;
}
/* sub/superscript icons must read as DIFFERENT at a glance (review R2):
   push the small character clearly above/below the x */
.rp-tbtn sup, .rp-tbtn sub { font-size: 9px; position: relative; }
.rp-tbtn sup { top: -5px; }
.rp-tbtn sub { top: 5px; }
.rp-tbtn svg { width: 15px; height: 15px; display: block; }
.rp-tbtn:hover { background: var(--bg-subtle); border-color: var(--line-strong); }
.rp-tbtn:focus-visible { outline: none; box-shadow: var(--focus); }
/* the focused block's type reflects on its toolbar button (review R3):
   a quiet fill + an ink baseline — selection grammar, not decoration */
.rp-tbtn.is-active {
  background: var(--bg-subtle);
  border-color: var(--line-strong);
  box-shadow: inset 0 -2px 0 0 var(--accent);
}
.rp-tbtn--danger:hover { color: var(--danger); border-color: var(--danger); }
.rp-btn {
  font: inherit; font-size: var(--fs-body); font-weight: 600; padding: 6px 12px;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); cursor: pointer;
}
.rp-btn:hover { background: var(--bg-subtle); }
.rp-btn--primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.rp-btn:focus-visible { outline: none; box-shadow: var(--focus); }

.rp-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 30px 22px 60px; }

/* the paper: a transparent stage over real A4 sheets (W4). The sheets are a
   pointer-events-none underlay report-app sizes and counts; the content flows
   above them and the pagination pass keeps blocks off the page edges. */
.rp-page {
  position: relative;
  /* the sheets sit at z:-1 INSIDE this stacking context: they paint above
     the app's grey but below the (static, unpositioned) content — keeping
     the content unpositioned keeps every offsetTop page-relative, which the
     pagination measure pass depends on */
  isolation: isolate;
  width: 100%; max-width: 780px; margin: 0 auto; min-height: 900px;
  color: var(--rp-ink);
  padding: 72px 78px;
}
.rp-sheets { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.rp-sheet {
  position: absolute; left: 0; right: 0;
  background: var(--rp-paper);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 4px rgba(0,0,0,0.09);
}
/* on-screen page number, in the print stamp's corner (round 4 #4) */
.rp-sheet__num {
  position: absolute; right: 26px; bottom: 20px;
  font-size: 10.5px; font-variant-numeric: tabular-nums;
  color: #b3b9bf;
}

.rp-title {
  display: block; width: 100%; border: none; background: none; color: var(--rp-ink);
  font: inherit; font-size: 30px; font-weight: 750; letter-spacing: -0.015em;
  line-height: 1.2; padding: 0 0 6px; margin-bottom: 26px;
  border-bottom: 2px solid var(--rp-ink);
  /* a textarea so long titles wrap (round 2 #1) — report-app grows the height */
  resize: none; overflow: hidden;
}
.rp-title:focus-visible { outline: none; box-shadow: none; border-radius: 0; }
.rp-title::placeholder { color: #b9bec3; }

/* blocks */
.rp-block { position: relative; margin: 0 0 14px; min-height: 1.3em; }
.rp-block:focus-visible { outline: none; }
/* one quiet grey line marks the active block (round 4 #5 — the ink segment
   read as a scrollbar-like artefact) */
.rp-block:focus {
  outline: none;
  box-shadow: -3px 0 0 0 #d7dbde;
}
h2.rp-block { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 26px 0 10px; }
h3.rp-block { font-size: 16px; font-weight: 650; margin: 20px 0 8px; }
p.rp-block { font-size: 14.5px; line-height: 1.7; }
ul.rp-block, ol.rp-block { font-size: 14.5px; line-height: 1.7; padding-left: 26px; }
.rp-block li { margin-bottom: 4px; }
.rp-block a { color: inherit; }
.rp-block:first-child { margin-top: 0; }

/* empty-paragraph affordance — on the FOCUSED empty paragraph only (round 2
   #5): skipped lines shouldn't read as a column of "Write…" ghosts */
p.rp-block:empty:focus::before { content: "Write…"; color: #c3c8cc; pointer-events: none; }

/* a selected run of whole blocks (W3) — the same selection blue as table
   cells, bled slightly past the text column so it reads as "the block" */
.rp-block.is-blocksel {
  background: #dbe7f8;
  box-shadow: 0 0 0 5px #dbe7f8;
  border-radius: 1px;
}

/* the page-break block (round 2 #6): a quiet dashed rule on screen — the
   pagination pass starts the next block on a fresh sheet; print gets a real
   break-after:page */
.rp-block--pagebreak {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0; cursor: default; user-select: none;
}
.rp-block--pagebreak::before, .rp-block--pagebreak::after {
  content: ""; flex: 1; border-top: 1px dashed #c4cad0;
}
.rp-pgbreak__label {
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: #b3b9bf;
}
.rp-block--pagebreak:focus-visible { outline: none; box-shadow: none; border-radius: 0; }
.rp-block--pagebreak:focus .rp-pgbreak__label { color: var(--rp-ink); }
.rp-block--pagebreak:focus::before, .rp-block--pagebreak:focus::after {
  border-top-color: #8a9096;
}
@media print {
  .rp-block--pagebreak {
    break-after: page;
    height: 0; margin: 0; overflow: hidden; visibility: hidden;
  }
}

/* inline equations (round 4 #2): an inert atom in the text line, edited in a
   floating slot editor. Inline MathML sizes itself compact natively. */
.rp-ieq {
  display: inline; padding: 0 1px; border-radius: 2px; cursor: pointer;
  font-family: "Latin Modern Math", "Cambria Math", "STIX Two Math", math;
}
.rp-ieq:hover { background: #eef2f8; }
.rp-ieq.is-editing { background: #eef2f8; box-shadow: inset 0 0 0 1px #c6ccd2; }
.rp-ieq-pop {
  position: absolute; z-index: 8; width: max-content; max-width: 340px;
  padding: 8px; background: var(--rp-paper);
  border: 1px solid #dfe3e6; border-radius: var(--radius);
  box-shadow: 0 3px 12px rgba(0,0,0,0.13);
}
/* inside the popover the picker is part of the card, not an overlay */
.rp-ieq-pop .eqe-picker {
  position: static; transform: none; width: auto; max-width: none;
  margin-top: 7px; padding: 6px 0 0; border: none; border-radius: 0;
  box-shadow: none; border-top: 1px solid #eceff1;
}
@media print {
  .rp-ieq-pop { display: none !important; }
  .rp-ieq { background: none; box-shadow: none; }
}

/* the equation block (E3b): rendered MathML; source line while focused */
.rp-block--eq { padding: 4px 0; }
.rp-eq__render { text-align: center; font-size: 19px; min-height: 30px;
  display: flex; align-items: center; justify-content: center; }
/* the hidden attribute must beat the display:flex above (edit-mode swap) */
.rp-eq__render[hidden], .rp-eq__edit[hidden] { display: none; }
.rp-eq__render math { font-size: 19px; }
.rp-eq__hint { font-size: 12.5px; color: #b9bec3; }
.rp-eq__bad { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; color: var(--rp-muted-ink); background: #f6f7f8;
  padding: 3px 8px; border-radius: 3px; }
.rp-block--eq.is-error .rp-eq__bad { box-shadow: 0 1px 0 0 #d92020; }
.rp-eq__src {
  display: none; width: 100%; margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--rp-muted-ink);
  background: #f6f7f8; border: 1px solid #e3e6e8; border-radius: 3px;
  padding: 6px 9px;
}
/* the editing state is class-driven (focusin/focusout in JS) — pure
   :focus-within can't work here: you cannot focus() a display:none input */
.rp-block--eq.is-editing .rp-eq__src { display: block; }
.rp-eq__src:focus-visible { outline: none; border-color: #9aa0a6; box-shadow: none; }

/* narrow */
@media (max-width: 720px) {
  .rp-app { grid-template-columns: 64px 1fr; }
  .rp-scroll { padding: 14px 8px 40px; }
  .rp-page { padding: 34px 26px 50px; }
  .rp-toolbar { overflow-x: auto; }
}

/* ── print: the page IS the export ─────────────────────────────────────────── */
@media print {
  .site-header, .rp-rail, .rp-toolbar { display: none !important; }
  html, body { background: #fff !important; }
  .rp-app { display: block; height: auto; background: none; }
  .rp-main { display: block; }
  .rp-scroll { overflow: visible; padding: 0; }
  .rp-page {
    max-width: none; min-height: 0; margin: 0; border: none; box-shadow: none;
    padding: 0; color: #000;
  }
  .rp-sheets { display: none !important; } /* print flows its own real pages */
  .rp-title { border-bottom-color: #000; }
  .rp-block:focus { box-shadow: none; }
  p.rp-block:empty::before { content: none; }
  .rp-eq__src { display: none !important; }
  .rp-eq__hint { display: none; }
}

/* the ink rail (same grammar as the Sketch room) */
.rp-rail {
  display: flex; flex-direction: column; align-items: stretch;
  background: var(--ink-spine-bg); border-right: 1px solid var(--ink-spine-line);
  padding: 10px 0;
}
.rp-rail__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 2px; border: none; background: none; cursor: pointer;
  color: var(--ink-spine-text); font: inherit; font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.01em; text-decoration: none; text-align: center;
}
.rp-rail__item[hidden] { display: none; } /* the class display beats the UA [hidden] rule */
.rp-rail__item:hover { background: var(--ink-spine-hover); color: var(--ink-spine-text-strong); }
.rp-rail__item.is-active { color: var(--ink-spine-text-strong); background: var(--ink-spine-active); }
.rp-rail__item.is-active::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--ink-spine-marker);
}
.rp-rail__item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.rp-rail__item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ink-spine-marker); }
.rp-rail__sep { height: 1px; margin: 8px 12px; background: var(--ink-spine-line); }

/* the rail's bottom register (review tile B): File · (Save, tile C) · Apps */
.rp-rail__spring { flex: 1; }

/* read-only (a teacher viewing a student's doc, tile C) */
.rp-ribbon {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: 9px 14px; font-size: var(--fs-caption); color: var(--text);
  background: var(--warning-soft); border-bottom: 1px solid var(--warning);
}
.rp-ribbon strong { font-weight: 650; }
.rp-readonly .rp-toolbar .rp-tbtn { opacity: 0.35; pointer-events: none; }

/* ── the WYSIWYG equation editor (tile D) ──────────────────────────────────
   Slot editing: runs are tiny contenteditables, structures are CSS-built.
   The reading view (real MathML) swaps back in on blur. */
.rp-eq__edit { text-align: center; padding: 2px 0 4px; }
.eqe {
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: 100%;
}
.eqe-row { display: inline-flex; align-items: center; white-space: nowrap; }
.eqe-root { font-size: 19px; padding: 4px 6px; border-radius: 3px;
  background: #f8f9f9; box-shadow: inset 0 0 0 1px #e3e6e8;
  /* the editing view wears the SAME math font as the final render (Moey W4) */
  font-family: "Latin Modern Math", "Cambria Math", "STIX Two Math", math; }
.eqe-run {
  display: inline-block; min-width: 8px; min-height: 1.2em; padding: 0 1px;
  font-style: italic; outline: none; white-space: pre;
}
.eqe-run:focus { background: #eef2f8; border-radius: 2px; }
/* the active slot wears a hairline, not the site-wide glow (round 2 #4) —
   the glow's spread swallowed neighbouring characters */
.eqe-run:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px #c6ccd2;
  border-radius: 2px;
}
.eqe-run:empty::before { content: "​"; } /* zero-width space keeps height */
.eqe-struct { display: inline-flex; vertical-align: middle; }
.eqe-frac { flex-direction: column; align-items: stretch; margin: 0 2px; }
/* stretch + centre so the divider always spans the WIDER of num/den (Moey W3) */
.eqe-frac__num, .eqe-frac__den { display: flex; justify-content: center;
  padding: 0 4px; font-size: 0.82em; }
.eqe-frac__num { border-bottom: 1.5px solid currentColor; }
.eqe-sqrt { align-items: stretch; margin: 0 2px; }
.eqe-sqrt__tick { display: flex; align-self: stretch; width: 12px; }
.eqe-sqrt__tick svg { width: 100%; height: 100%; display: block; }
.eqe-sqrt__body { border-top: 1.6px solid currentColor; padding: 0 3px;
  display: inline-flex; align-items: center; }
.eqe-sup, .eqe-sub { font-size: 0.72em; margin: 0 1px; }
.eqe-sup { transform: translateY(-0.55em); }
.eqe-sub { transform: translateY(0.35em); }
/* empty slots show as quiet dashed boxes so structure reads at a glance */
.eqe-struct .eqe-run:only-child:empty,
.eqe-frac .eqe-run:only-child:empty,
.eqe-sqrt__body .eqe-run:only-child:empty {
  box-shadow: inset 0 0 0 1px #c4cad0; border-radius: 2px; min-width: 14px;
}

/* the picker bar: structures + science symbols. An OVERLAY below the
   equation (round 4 #1): editing must never shift the content beneath. */
.eqe-picker {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 3px;
  position: absolute; top: calc(100% + 5px); left: 50%;
  transform: translateX(-50%); width: max-content; max-width: 100%;
  z-index: 6;
  padding: 6px 8px; background: var(--rp-paper);
  border: 1px solid #dfe3e6; border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.eqe-chip {
  min-width: 26px; height: 26px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 3px;
  background: none; color: var(--rp-ink); font: inherit; font-size: 13px;
  cursor: pointer;
}
.eqe-chip:hover { background: #f0f2f3; border-color: #d4d8da; }
.eqe-chip sup, .eqe-chip sub { font-size: 9px; }
.eqe-chip__frac { display: inline-flex; flex-direction: column; line-height: 1;
  font-size: 9px; }
.eqe-chip__frac i:first-child { border-bottom: 1px solid currentColor; }
.eqe-picker__sep { width: 1px; align-self: stretch; margin: 2px 4px;
  background: #e3e6e8; }

@media print {
  .rp-eq__edit, .eqe-picker { display: none !important; }
}

/* the power/index chips must read differently at a glance (review) */
.eqe-chip sup, .eqe-chip sub { position: relative; }
.eqe-chip sup { top: -4px; }
.eqe-chip sub { top: 4px; }

/* nth-root: a small raised index slot before the radical */
.eqe-sqrt__idx { font-size: 0.65em; align-self: flex-start; margin-right: -3px;
  transform: translateY(-0.3em); }
.eqe-picker { flex-direction: column; }
.eqe-picker__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.eqe-picker__row--more { border-top: 1px solid #eceff0; margin-top: 5px; padding-top: 6px; }
.eqe-picker__row--more[hidden] { display: none; }
.eqe-chip.is-active { background: #eef0f1; border-color: #d4d8da; }

/* word count strip (Moey W10) */
.rp-statusbar {
  flex: none; padding: 5px 18px; text-align: right;
  font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--muted);
  background: var(--panel); border-top: 1px solid var(--line);
}

/* page numbers in the print footer (Moey W9). Chromium's @page margin-box
   support is partial — harmless where unsupported (the footer just stays
   blank), correct where it works. */
@media print {
  .rp-statusbar { display: none !important; }
  @page {
    margin: 2cm 1.8cm 2.2cm;
    @bottom-right { content: counter(page); font-size: 10px; color: #666; }
  }
}

/* ── the table block (Moey polish W6) ──────────────────────────────────────── */
.rp-block--table { padding: 2px 0; }
.rp-block--table table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px; line-height: 1.5;
}
.rp-block--table th, .rp-block--table td {
  border: 1px solid #cfd4d7; padding: 6px 10px; text-align: left;
  min-width: 40px; outline: none;
}
.rp-block--table th {
  font-weight: 650; background: #f5f6f7; border-bottom: 2px solid #1a1a1a;
}
.rp-block--table th:focus, .rp-block--table td:focus { background: #eef2f8; }
/* the focused cell wears a quiet inset sliver (round 2 #3) — the site-wide
   focus glow is far too heavy inside a hairline grid. Inset, so the
   multi-select tint can never paint over it. */
.rp-block--table th:focus-visible, .rp-block--table td:focus-visible {
  box-shadow: inset 0 0 0 1px #9aa1a7; border-radius: 0;
}
/* fixed layout once the user has sized columns — % shares on the <col>s */
.rp-block--table table.is-sized { table-layout: fixed; }
.rp-block--table table.is-sized th, .rp-block--table table.is-sized td {
  overflow-wrap: break-word;
}
/* the drag grip riding each inner column border (header row only) */
.rp-block--table th { position: relative; }
.rp-tbl__grip {
  position: absolute; top: 0; right: -5px; width: 9px; height: 100%;
  cursor: col-resize; user-select: none; z-index: 2;
}
.rp-tbl__grip:hover, .rp-tbl__grip:active {
  background: linear-gradient(to right, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px);
}
/* the cell-selection tint (kept distinct from the single-cell focus wash) */
.rp-block--table th.is-sel, .rp-block--table td.is-sel { background: #dbe7f8; }
.rp-block--table table.is-dragsel { user-select: none; }
/* the mini-bar OVERLAYS the content below instead of shifting it (round 4
   #1) — leaving a table focused must never change where things sit */
.rp-tbl__bar {
  display: none; gap: 4px; justify-content: center;
  position: absolute; top: calc(100% + 5px); left: 50%;
  transform: translateX(-50%); white-space: nowrap; z-index: 6;
  padding: 5px 8px; background: var(--rp-paper);
  border: 1px solid #dfe3e6; border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.rp-block--table.is-editing .rp-tbl__bar { display: flex; }
.rp-tbl__bar .eqe-chip { font-size: 12px; border: 1px solid #e3e6e8; background: var(--rp-paper); }
.rp-tbl__delchip { color: var(--danger); margin-left: 10px; }
.rp-tbl__delchip:hover { border-color: var(--danger); }

@media print {
  .rp-tbl__bar, .rp-tbl__grip { display: none !important; }
  .rp-block--table th { background: #f0f0f0 !important; }
  .rp-block--table tr { break-inside: avoid; }
  .rp-block--table th:focus, .rp-block--table td:focus,
  .rp-block--table td.is-sel { background: none; }
}

/* ── the figure block (E3b): a workspace graph/sketch over a numbered caption ── */
.rp-block--figure { padding: 2px 0; margin: 18px 0; text-align: center; }
.rp-fig__img {
  display: block; max-width: 100%; margin: 0 auto;
  border: 1px solid #e3e6e8;
}
.rp-block--figure.is-editing .rp-fig__img { border-color: #9aa0a6; }
.rp-fig__cap {
  margin-top: 8px; font-size: 12.5px; line-height: 1.5;
  color: var(--rp-muted-ink); text-align: center;
}
.rp-fig__num { font-weight: 650; }
.rp-fig__captext { outline: none; }
.rp-fig__captext:focus-visible { box-shadow: none; border-radius: 0; } /* the caret is enough */
.rp-fig__captext:empty::before { content: "Add a caption…"; color: #c3c8cc; }

@media print {
  .rp-block--figure { break-inside: avoid; }
  .rp-fig__img { border-color: #d8dbde; }
  .rp-fig__captext:empty::before { content: none; }
}

/* ── EM2 · teacher margin comments (Word-style rail) ─────────────────────────
   Highlights wear the brand-yellow selection marker (selection grammar, CI §4);
   cards sit in an absolute rail right of the paper. The rail only exists on
   wide read-only views; narrow screens get the fixed count pill instead. */
.rp-cmark {
  background: rgba(255, 219, 0, 0.32);
  border-radius: 1px;
  color: inherit;
}
.rp-cmark.is-active { background: rgba(255, 219, 0, 0.55); }
[data-theme="dark"] .rp-cmark { background: rgba(255, 219, 0, 0.24); color: inherit; }
[data-theme="dark"] .rp-cmark.is-active { background: rgba(255, 219, 0, 0.4); }

/* shift the paper left to make room for the rail (wide only — the JS gates) */
body.rp-has-crail .rp-page { margin-left: max(22px, calc(50% - 540px)); }

.rp-crail {
  position: absolute; top: 0; bottom: 0;
  left: calc(100% + 20px); width: 264px;
}
.rp-ccard {
  position: absolute; left: 0; width: 100%;
  background: var(--panel, var(--bg));
  border: 1px solid var(--line-strong);
  border-left: 3px solid rgba(255, 219, 0, 0.9);
  border-radius: var(--radius);
  padding: 10px 12px 8px;
  font-size: 13px; line-height: 1.45;
  transition: top 0.15s ease;
}
.rp-ccard--flat { position: static; margin: 0 0 10px; transition: none; }
@media (prefers-reduced-motion: reduce) { .rp-ccard { transition: none; } }
.rp-ccard__quote {
  margin: 0 0 6px; color: var(--muted); font-style: italic;
  overflow-wrap: anywhere;
}
.rp-ccard__stale { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.rp-ccard__text { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-ccard__meta {
  display: flex; align-items: center; gap: 8px; margin: 0;
  color: var(--muted); font-size: 11.5px;
}
.rp-ccard__spring { flex: 1 1 auto; }
.rp-ccard__btn {
  font: inherit; font-size: 11.5px; font-weight: 600;
  background: none; border: none; padding: 2px 4px;
  color: var(--muted); cursor: pointer; border-radius: 2px;
}
.rp-ccard__btn:hover { color: var(--text); }
.rp-ccard__btn--danger:hover { color: var(--danger); }
.rp-ccard__btn--primary { color: var(--text); }
.rp-ccard__btn:focus-visible { outline: none; box-shadow: var(--focus); }
.rp-ccard__input {
  display: block; width: 100%; min-height: 64px; resize: vertical;
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 6px 8px; margin: 0 0 8px;
}
.rp-ccard__input:focus-visible { outline: none; box-shadow: var(--focus); }

/* the floating selection chip */
.rp-cchip {
  position: absolute; z-index: 40;
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12px; font-weight: 650;
  padding: 5px 10px; cursor: pointer;
  background: var(--text); color: var(--bg);
  border: none; border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.rp-cchip__glyph { color: #ffdb00; font-weight: 800; letter-spacing: -0.08em; }
.rp-cchip:focus-visible { outline: none; box-shadow: var(--focus); }

/* the count pill (narrow screens / editing a returned draft) */
.rp-cpill {
  position: fixed; right: 16px; bottom: 18px; z-index: 50;
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 12.5px; font-weight: 650;
  padding: 8px 14px; cursor: pointer;
  background: var(--text); color: var(--bg);
  border: none; border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.rp-cpill__n {
  background: #ffdb00; color: #15171a;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 750; padding: 0 4px;
}
.rp-cpill:focus-visible { outline: none; box-shadow: var(--focus); }

.rp-cdlg .rp-cdlg__list { max-height: 55vh; overflow-y: auto; margin: 4px 0 10px; }

@media print {
  .rp-crail, .rp-cpill, .rp-cchip { display: none !important; }
  .rp-cmark { background: none !important; }
}
