/* v2.18.3 The research environment, redesigned. Ink navy + teal + citation gold. One memorable thing: the serif research
   question on the ink card. Everything else stays quiet. Uses the app's surface tokens so dark mode follows. */
.rs-main { --ink: #0b1b33; --ink-2: #14315a; --teal: #0e7c86; --gold: #e0b04f; --gold-ink: #3a2a05; --serif: Georgia, "Iowan Old Style", "Times New Roman", serif; }
.rx-page { max-width: 760px; margin: 0 auto; padding: 4px 16px 28px; display: flex; flex-direction: column; gap: 16px; }
.rx-page h1, .rx-page h2 { margin: 0; letter-spacing: -.01em; }
.rx-greet p { margin: 0 0 2px; font-size: .8rem; color: var(--muted); }
.rx-greet h1 { font-size: 1.55rem; line-height: 1.15; }
.rx-ph { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rx-ph h1 { font-size: 1.55rem; line-height: 1.15; }
.rx-ph p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.rx-add { display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap; min-height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: .9rem; cursor: pointer; }
.rx-add svg { width: 18px; height: 18px; }

/* the ink card */
.rx-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px 18px 18px; color: #eef3fb; background: radial-gradient(120% 90% at 100% 0%, #1d4f8f 0%, transparent 55%), linear-gradient(160deg, var(--ink), var(--ink-2)); box-shadow: 0 14px 34px rgba(11, 27, 51, .28); }
.rx-hero::after { content: "“"; position: absolute; right: 10px; top: -34px; font: 700 9rem/1 var(--serif); color: rgba(224, 176, 79, .13); pointer-events: none; }
.rx-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.rx-stage-tag { display: inline-flex; align-items: center; min-height: 26px; padding: 0 11px; border-radius: 999px; background: rgba(255, 255, 255, .13); font-size: .75rem; font-weight: 700; }
.rx-stage-tag.lt { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); }
.rx-due { font-size: .78rem; font-weight: 600; color: #b9c9e0; }
.rx-due.soon { color: var(--gold); }
.rx-hero-q { position: relative; z-index: 1; display: block; margin: 14px 0 16px; font: 400 1.32rem/1.35 var(--serif); color: #fff; text-decoration: none; overflow-wrap: anywhere; }
.rx-hero.empty .rx-hero-q { margin-top: 4px; }
.rx-hero-sub { position: relative; z-index: 1; margin: -6px 0 16px; font-size: .92rem; line-height: 1.5; color: #c4d2e6; }
.rx-hero-meta { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.rx-hero-nums { display: flex; gap: 18px; flex-wrap: wrap; font-size: .75rem; color: #b9c9e0; }
.rx-hero-nums span { display: flex; flex-direction: column; }
.rx-hero-nums b { font-size: 1.2rem; color: #fff; line-height: 1.1; }
.rx-hero-acts { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.rx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: .92rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.rx-btn svg { width: 18px; height: 18px; }
.rx-btn.gold { background: var(--gold); color: var(--gold-ink); }
.rx-btn.ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .22); }

/* progress ring */
.rx-ring { --p: 0; flex: none; position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--gold, #e0b04f) calc(var(--p) * 1%), color-mix(in srgb, var(--muted) 25%, transparent) 0); }
.rx-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--card, var(--surface)); }
.rx-ring.on-ink { background: conic-gradient(#e0b04f calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0); }
.rx-ring.on-ink::before { background: #12294d; }
.rx-ring b { position: relative; font-size: .8rem; }
.rx-ring.on-ink b { color: #fff; }
.rx-ring.sm { width: 46px; height: 46px; background: conic-gradient(var(--teal) calc(var(--p) * 1%), color-mix(in srgb, var(--muted) 22%, transparent) 0); }
.rx-ring.sm::before { inset: 5px; }
.rx-ring.sm b { font-size: .66rem; }

/* next step, quick actions, totals */
.rx-next { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--card, var(--surface)); border: 1px solid var(--border); color: var(--fg); text-decoration: none; }
.rx-next > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rx-next small { color: var(--muted); font-size: .72rem; }
.rx-next b { font-size: .95rem; }
.rx-next > svg { width: 18px; height: 18px; color: var(--muted); }
.rx-next-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); }
.rx-next-ic svg { width: 21px; height: 21px; }
.rx-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rx-q { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 18px; background: var(--card, var(--surface)); border: 1px solid var(--border); color: var(--fg); text-decoration: none; font-size: .74rem; font-weight: 600; text-align: center; }
.rx-q span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; background: color-mix(in srgb, var(--primary) 11%, transparent); color: var(--primary); }
.rx-q svg { width: 20px; height: 20px; }
.rx-totals { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 18px; background: var(--card, var(--surface)); border: 1px solid var(--border); }
.rx-totals div { display: flex; flex-direction: column; align-items: center; padding: 12px 4px; }
.rx-totals div + div { border-left: 1px solid var(--border); }
.rx-totals b { font-size: 1.25rem; }
.rx-totals span { font-size: .72rem; color: var(--muted); }
.rx-sec { display: flex; flex-direction: column; gap: 10px; }
.rx-sec h2 { font-size: 1.02rem; }
.rx-sec-h { display: flex; align-items: baseline; justify-content: space-between; }
.rx-sec-h a { font-size: .82rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.rx-list { display: flex; flex-direction: column; gap: 8px; }
.rx-prow { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 18px; background: var(--card, var(--surface)); border: 1px solid var(--border); color: var(--fg); text-decoration: none; }
.rx-prow-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rx-prow-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-prow-t small { color: var(--muted); font-size: .76rem; }
.rx-prow > svg { width: 17px; height: 17px; color: var(--muted); }
.rx-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rx-feed li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.rx-feed li:last-child { border: 0; }
.rx-feed i { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--muted); }
.rx-feed i.s { background: var(--teal); }
.rx-feed span { display: flex; flex-direction: column; min-width: 0; }
.rx-feed small { color: var(--muted); font-size: .74rem; }
.rx-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.rx-foot a, .rx-link { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none; }
.rx-link { justify-content: space-between; border-radius: 16px; min-height: 48px; color: var(--fg); background: var(--card, var(--surface)); }
.rx-foot svg, .rx-link svg { width: 16px; height: 16px; }

/* projects list */
.rx-search { width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--card, var(--surface)); color: var(--fg); font-size: 1rem; }
.rx-search.big { min-height: 52px; border-radius: 18px; }
.rx-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.rx-chips button { flex: none; min-height: 36px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--border); background: none; color: var(--muted); font-weight: 600; font-size: .84rem; cursor: pointer; }
.rx-chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.rx-cards { display: flex; flex-direction: column; gap: 12px; }
.rx-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 20px; background: var(--card, var(--surface)); border: 1px solid var(--border); color: var(--fg); text-decoration: none; }
.rx-card-top { display: flex; align-items: center; gap: 12px; }
.rx-card-t { display: flex; flex-direction: column; min-width: 0; }
.rx-card-t b { font-size: 1rem; overflow-wrap: anywhere; }
.rx-card-t small { color: var(--muted); }
.rx-card p { margin: 0; font: 400 .95rem/1.45 var(--serif); color: color-mix(in srgb, var(--fg) 82%, transparent); }
.rx-card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: .76rem; color: var(--muted); }
.rx-card-foot .rx-stage-tag { min-height: 24px; }
.rx-none { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted); }
.rx-none svg { width: 30px; height: 30px; }
.rx-none b { color: var(--fg); }

/* discover */
.rx-searchrow { position: relative; }
.rx-searchrow .rx-search { padding-right: 56px; }
.rx-go { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 13px; background: var(--ink); color: #fff; cursor: pointer; }
.rx-go svg { width: 19px; height: 19px; }
.rx-ideas { display: flex; flex-direction: column; gap: 8px; }
.rx-ideas p { margin: 4px 0 0; font-size: .82rem; color: var(--muted); font-weight: 600; }
.rx-ideas button { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 15px; border: 1px solid var(--border); background: var(--card, var(--surface)); color: var(--fg); text-align: left; font-size: .9rem; cursor: pointer; }
.rx-ideas svg { width: 16px; height: 16px; color: var(--teal); flex: none; }
.rx-results { display: flex; flex-direction: column; gap: 12px; }
.rx-paper { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 18px; background: var(--card, var(--surface)); border: 1px solid var(--border); }
.rx-paper > b { font: 700 1.02rem/1.3 var(--serif); }
.rx-paper > small { color: var(--teal); font-weight: 600; }
.rx-abs { margin: 2px 0 0; font-size: .88rem; line-height: 1.5; color: color-mix(in srgb, var(--fg) 80%, transparent); }
.rx-more { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--primary); font-weight: 600; font-size: .82rem; cursor: pointer; }
.rx-paper-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; font-size: .76rem; color: var(--muted); }
.rx-paper-foot .oa { color: var(--teal); font-weight: 700; }
.rx-paper-foot a { color: var(--primary); font-weight: 600; }
.rx-save { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }
.rx-save.done { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.rx-save svg { width: 16px; height: 16px; }
.rx-pick { display: flex; flex-direction: column; gap: 8px; }
.rx-pick button { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--card, var(--surface)); color: var(--fg); text-align: left; cursor: pointer; }
.rx-pick small { grid-column: 1; color: var(--muted); }
.rx-pick svg { grid-row: 1 / 3; grid-column: 2; width: 17px; height: 17px; }

/* lab */
.rx-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: color-mix(in srgb, var(--muted) 14%, transparent); }
.rx-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-weight: 700; font-size: .86rem; cursor: pointer; }
.rx-seg button.on { background: var(--card, var(--surface)); color: var(--fg); box-shadow: 0 2px 8px rgba(11, 27, 51, .14); }
.rx-seg svg { width: 17px; height: 17px; }
.rx-panel { display: flex; flex-direction: column; gap: 12px; }
.rx-panel .input, .rx-panel select, .rx-panel textarea { width: 100%; box-sizing: border-box; min-height: 46px; font-size: 1rem; }
.rx-hint { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.45; }
.rx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rx-stackf { display: flex; flex-direction: column; gap: 10px; }
.rx-lab { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.rx-result { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; background: var(--card, var(--surface)); border: 1px solid var(--border); border-left: 4px solid var(--gold); box-shadow: 0 8px 24px rgba(11, 27, 51, .12); }
.rx-result small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.rx-result .rs-lab-cite-out { font: 400 .98rem/1.5 var(--serif); overflow-wrap: anywhere; }
.rx-result .btn { align-self: flex-start; }
.rx-result table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rx-result td { padding: 4px 0; border-bottom: 1px solid var(--border); }
.rx-result td:last-child { text-align: right; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; }

/* tool tiles (project) */
.rx-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rx-tile { --h: 195; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; min-height: 132px; text-align: left; border-radius: 18px; border: 1px solid var(--border); background: var(--card, var(--surface)); color: var(--fg); cursor: pointer; }
.rx-tile.hue1 { --h: 215; } .rx-tile.hue2 { --h: 178; } .rx-tile.hue3 { --h: 38; } .rx-tile.hue4 { --h: 275; }
.rx-tile-ic { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 4px; border-radius: 12px; background: hsl(var(--h) 60% 92%); color: hsl(var(--h) 65% 30%); }
.rx-tile-ic svg { width: 20px; height: 20px; }
.rx-tile b { font-size: .88rem; line-height: 1.25; }
.rx-tile small { font-size: .73rem; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-color-scheme: dark) { .rx-tile-ic { background: hsl(var(--h) 40% 22%); color: hsl(var(--h) 80% 80%); } .rx-add, .rx-go, .rx-save, .rx-chips button.on { background: #1d4f8f; border-color: #1d4f8f; } }
:root[data-theme="dark"] .rx-tile-ic { background: hsl(var(--h) 40% 22%); color: hsl(var(--h) 80% 80%); }

/* the project's own tabs live in the bottom bar on a phone */
@media (max-width: 899px) { .rs-seg { display: none; } }
@media (min-width: 700px) { .rx-tiles { grid-template-columns: repeat(3, 1fr); } .rx-quick { gap: 12px; } }
@media (prefers-reduced-motion: no-preference) { .rx-hero { animation: rx-in .5s ease both; } @keyframes rx-in { from { opacity: 0; transform: translateY(6px); } } }
.rx-btn:focus-visible, .rx-q:focus-visible, .rx-card:focus-visible, .rx-tile:focus-visible, .rx-prow:focus-visible, .rx-add:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.rs-proj-title { font-size: 1.1rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.rx-result .rs-lab-stats-out, .rx-result .rs-lab-table td { color: var(--fg); }

/* ---------- the writing surface ---------- */
.rx-editor { display: flex; flex-direction: column; gap: 10px; }
.rs-ed-top { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.rs-ed-top .grow { flex: 1; }
.rx-tools { position: sticky; top: 0; z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 6px 0; background: var(--bg); }
.rx-fmt, .rx-ai { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--card, var(--surface)); }
.rx-fm { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 40px; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--fg); font: 600 .9rem system-ui, sans-serif; cursor: pointer; }
.rx-fm.b { font-weight: 800; } .rx-fm.i { font-style: italic; font-family: var(--serif); }
.rx-fm:active, .rx-fm:hover { background: color-mix(in srgb, var(--muted) 16%, transparent); }
.rx-fm svg { width: 18px; height: 18px; }
.rx-fm.cite { margin-left: auto; color: var(--teal); }
.rx-ai { background: var(--ink); border-color: var(--ink); }
.rx-ai-l { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px 0 6px; color: var(--gold); font-weight: 800; font-size: .78rem; }
.rx-ai-l svg { width: 16px; height: 16px; }
.rx-aichip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; font-size: .82rem; cursor: pointer; }
.rx-aichip.hot { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.rx-aichip svg { width: 15px; height: 15px; }
.rx-aichip:disabled { opacity: .5; }
.rx-ed-result { padding: 14px; border-radius: 16px; border: 1px solid var(--border); border-left: 4px solid var(--gold); background: var(--card, var(--surface)); }
.rx-ed-result.hidden { display: none; }
.rx-paperwrap { padding: 20px 18px 28px; border-radius: 18px; border: 1px solid var(--border); background: var(--card, var(--surface)); box-shadow: 0 6px 24px rgba(11, 27, 51, .07); }
.rx-ed-title { width: 100%; box-sizing: border-box; padding: 0 0 12px; margin: 0 0 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--fg); font: 700 1.5rem/1.25 var(--serif); }
.rx-ed-title:focus { outline: none; border-color: var(--teal); }
.rx-doc { position: relative; min-height: 46vh; outline: none; font: 400 1.06rem/1.75 var(--serif); color: var(--fg); overflow-wrap: anywhere; }
.rx-doc.empty::before { content: attr(data-ph); position: absolute; left: 0; right: 0; color: var(--muted); pointer-events: none; }
.rx-doc p, .rx-pbody p { margin: 0 0 .85em; }
.rx-doc h2, .rx-psec h2 { margin: 1.2em 0 .4em; font: 700 1.25rem/1.3 var(--serif); }
.rx-doc h3 { margin: 1em 0 .3em; font: italic 700 1.08rem/1.3 var(--serif); }
.rx-doc ul, .rx-doc ol, .rx-pbody ul, .rx-pbody ol { margin: 0 0 .9em; padding-left: 1.4em; }
.rx-doc li, .rx-pbody li { margin: .25em 0; }
.rx-doc blockquote, .rx-pbody blockquote { margin: 0 0 .9em; padding: .2em 0 .2em 1em; border-left: 3px solid var(--gold); color: color-mix(in srgb, var(--fg) 78%, transparent); }
.rx-doc table, .rx-pbody table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font: .88rem/1.4 system-ui, sans-serif; display: block; overflow-x: auto; }
.rx-doc th, .rx-doc td, .rx-pbody th, .rx-pbody td { padding: 6px 9px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.rx-doc th, .rx-pbody th { background: color-mix(in srgb, var(--teal) 10%, transparent); }
.rx-ed-status { cursor: pointer; }

/* switch (Sections | Paper, Chat | Tools) */
.rx-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 16px; background: color-mix(in srgb, var(--muted) 15%, transparent); }
.rx-switch button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-weight: 700; font-size: .88rem; cursor: pointer; }
.rx-switch button svg { width: 17px; height: 17px; }
.rx-switch button.on { background: var(--card, var(--surface)); color: var(--fg); box-shadow: 0 2px 8px rgba(11, 27, 51, .14); }
.rx-switch.big button { min-height: 48px; }
.rx-switch.big button.sw-chat.on { background: var(--ink); color: #fff; }
.rx-switch.big button.sw-tools.on { background: var(--gold); color: var(--gold-ink); }
.rx-switch.big button.sw-tools:not(.on) { color: var(--gold-ink); background: color-mix(in srgb, var(--gold) 22%, transparent); }

/* paper preview */
.rx-stack { display: flex; flex-direction: column; gap: 14px; }
.rx-paperhead { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; color: var(--muted); }
.rx-paperhead b { color: var(--fg); font-size: .9rem; }
.rx-sheet { padding: 28px 22px 32px; border-radius: 6px; background: #fff; color: #1a1f2b; border: 1px solid var(--border); box-shadow: 0 12px 34px rgba(11, 27, 51, .14); font: 400 1rem/1.7 var(--serif); }
.rx-sheet h1 { margin: 0 0 8px; font: 700 1.55rem/1.25 var(--serif); text-align: center; }
.rx-sheet .rx-q2 { margin: 0 0 6px; text-align: center; font-style: italic; color: #33465e; }
.rx-sheet .rx-by { margin: 0 0 24px; text-align: center; font: .8rem system-ui, sans-serif; color: #5b6b80; }
.rx-psec { position: relative; margin-bottom: 8px; }
.rx-psec h2 { color: #0b1b33; font-size: 1.2rem; }
.rx-pedit { position: absolute; right: 0; top: 0; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid #d3dbe6; border-radius: 999px; background: #fff; color: #33465e; font: 600 .72rem system-ui, sans-serif; cursor: pointer; }
.rx-pedit svg { width: 13px; height: 13px; }
.rx-psec.refs ol { padding-left: 1.5em; font-size: .92rem; }
.rx-psec.refs li { margin-bottom: .6em; padding-left: .2em; }
.rx-sheet .rs-empty { color: #5b6b80; }

/* new project: what are you writing */
.rx-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rx-kinds button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; border: 1px solid var(--border); background: var(--card, var(--surface)); color: var(--fg); font-weight: 600; font-size: .78rem; text-align: center; cursor: pointer; }
.rx-kinds button svg { width: 22px; height: 22px; color: var(--teal); }
.rx-kinds button.on { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: inset 0 0 0 1px var(--ink); }

/* a wider desktop writing room */
@media (min-width: 900px) {
  .rx-editor { max-width: 820px; margin: 0 auto; }
  .rx-paperwrap { padding: 36px 48px 48px; }
  .rx-ed-title { font-size: 1.8rem; }
  .rx-doc { font-size: 1.12rem; }
  .rx-sheet { max-width: 760px; margin: 0 auto; padding: 56px 64px 64px; }
  .rx-stack { max-width: 860px; margin: 0 auto; width: 100%; }
}
@media (prefers-color-scheme: dark) { .rx-sheet { background: #f7f8fb; } }
.rx-switch { flex: none; flex-grow: 0; height: auto; grid-auto-rows: 44px; align-items: stretch; }
.rx-switch.big { grid-auto-rows: 50px; }
.rx-switch button { flex-direction: row; height: 100%; min-height: 0; }
