body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font:
    16px/1.65 system-ui,
    sans-serif;
}
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 0.5rem 1rem;
  background: color-mix(in oklab, var(--card) 88%, transparent);
  border-bottom: 1px solid var(--border);
  font:
    12px ui-monospace,
    monospace;
  backdrop-filter: blur(6px);
}
.bar a {
  color: var(--muted-foreground);
  margin-right: 0.75rem;
}
.bar a.on {
  color: var(--brand);
  font-weight: 600;
}
.errors {
  margin: 0;
  padding: 1rem;
  background: var(--destructive);
  color: white;
  font:
    12px ui-monospace,
    monospace;
}
main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 60vh;
}
.doctitle {
  font-size: 2rem;
  margin: 0 0 2rem;
}
.scrim-scene {
  margin: 4rem 0;
}
.scrim-stage {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* Drawn entirely from --scene-progress, which the component writes onto the element.
   No JavaScript touches these shapes, and nothing re-renders as they move. */
.demo-progress {
  margin-top: 1rem;
}
.demo-progress__fill {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--brand);
  width: calc(var(--scene-progress, 0) * 100%);
  transform-origin: left;
  transition: none;
}
.demo-progress__label {
  display: block;
  margin-top: 0.4rem;
  font:
    11px ui-monospace,
    monospace;
  color: var(--muted-foreground);
}
.demo-progress::after {
  content: counter(p) '%';
  counter-reset: p calc(var(--scene-progress, 0) * 100);
  float: right;
  font:
    11px ui-monospace,
    monospace;
  color: var(--brand);
}

/* Editor beside its own output. Two panes, each scrolling on its own, because a shared
   scroll would tie a cursor in one to a position in the other and they are not the same
   document any more once one of them is rendered. */
.editing {
  height: calc(100dvh - 2.5rem);
  overflow: auto;
}
.editing .cm-editor {
  height: 100%;
  font:
    13px/1.7 ui-monospace,
    monospace;
}
.editing .cm-gutters {
  background: transparent;
  border-right: 1px solid color-mix(in oklab, currentColor 12%, transparent);
  color: color-mix(in oklab, currentColor 45%, transparent);
}
.editing .cm-activeLineGutter {
  background: color-mix(in oklab, currentColor 8%, transparent);
}
.muted {
  color: var(--muted-foreground);
}
p.muted:not(.small) {
  padding: 2rem;
  font:
    13px ui-monospace,
    monospace;
}

.browse {
  display: grid;
  grid-template-columns: 20rem 1fr;
  gap: 2rem;
  padding: 2rem;
  align-items: start;
}
.browse__side {
  display: grid;
  gap: 1rem;
}
.browse__hint {
  max-width: 34rem;
}
.browse__hint h1 {
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
}

/* The reader: identity above, body in the middle, its own contents down the right.
   One column below the breakpoint, where a rail beside the text is not a rail. */
.rfd {
  max-width: 74rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 60vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 3rem;
}
.rfd__head {
  grid-column: 1;
}
.rfd__body {
  grid-column: 1;
}
.rfd__rail {
  grid-column: 1;
}

@media (min-width: 64rem) {
  .rfd {
    grid-template-columns: minmax(0, 1fr) 16rem;
  }
  .rfd__head,
  .rfd__body {
    grid-column: 1;
  }
  .rfd__rail {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: 4.5rem;
    align-self: start;
    max-height: calc(100dvh - 6rem);
    overflow: auto;
  }
}

.rfd__eyebrow {
  font:
    12px ui-monospace,
    monospace;
  color: var(--muted-foreground);
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.rfd__head h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 1.25rem;
}
.rfd__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2rem;
  margin: 0 0 1rem;
  font-size: 0.875rem;
}
.rfd__meta dt {
  font:
    11px ui-monospace,
    monospace;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rfd__meta dd {
  margin: 0.15rem 0 0;
}
.rfd__state {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font:
    11px ui-monospace,
    monospace;
  color: var(--brand);
}
.rfd__actions {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1.5rem;
}
.rfd__body {
  padding-top: 2rem;
}
/* Code blocks set apart from the prose: a guide's examples of Markdoc are code blocks, and
   unboxed they read as more prose. */
.rfd__body pre {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font:
    13px/1.6 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  font-variant-ligatures: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.rfd__body :not(pre) > code {
  padding: 0.1em 0.35em;
  font-size: 0.875em;
  font-variant-ligatures: none;
  background: color-mix(in oklab, var(--foreground) 8%, transparent);
  border-radius: 4px;
}
.rfd__body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.rfd__body ::selection {
  background: color-mix(in oklch, var(--brand) 35%, transparent);
}

.rfd__railhead {
  font:
    11px ui-monospace,
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin: 0 0 0.75rem;
}
.rfd__rail nav ol {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.rfd__rail nav li {
  margin: 0.35rem 0;
}
.rfd__rail nav li[data-level='3'] {
  padding-left: 0.9rem;
}
.rfd__rail a {
  color: var(--muted-foreground);
  text-decoration: none;
}
.rfd__rail a:hover {
  color: var(--foreground);
}

.rfd__count {
  color: var(--muted-foreground);
}
.rfd__draft,
.rfd__thread {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--card);
  font-size: 0.8125rem;
}
.rfd__draft blockquote,
.rfd__thread blockquote {
  margin: 0 0 0.5rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--brand);
  color: var(--muted-foreground);
  font-style: italic;
}
.rfd__thread[data-detached] blockquote {
  border-left-color: var(--destructive);
}
.rfd__stale {
  color: var(--destructive);
  font:
    11px ui-monospace,
    monospace;
  margin: 0 0 0.5rem;
}
.rfd__draft textarea,
.rfd__reply textarea {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  padding: 0.5rem;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 4px);
}
.rfd__draft button,
.rfd__reply button {
  margin: 0.5rem 0.4rem 0 0;
  font: inherit;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
}
.rfd__draft button[type='submit'],
.rfd__reply button[type='submit'] {
  background: var(--brand);
  color: var(--background);
  border-color: transparent;
}
.rfd__thread p {
  margin: 0.35rem 0;
}
.rfd__thread {
  cursor: pointer;
}
.rfd__thread[data-active] {
  border-color: var(--brand);
}
.rfd__reply {
  cursor: auto;
  margin-top: 0.5rem;
}
.rfd__problem {
  color: var(--destructive);
  font-size: 0.8125rem;
}
.rfd__resolved summary {
  cursor: pointer;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  margin: 0.5rem 0;
}
.rfd__resolved .rfd__thread {
  cursor: auto;
  opacity: 0.7;
}
.rfd__ref {
  color: var(--brand);
}
/* Commented words: faint until their thread is the one being read. */
.rfd__body [data-comment] {
  background: color-mix(in oklab, var(--brand) 14%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--brand) 55%, transparent);
  cursor: pointer;
}
.rfd__body [data-comment][data-active] {
  background: color-mix(in oklab, var(--brand) 32%, transparent);
  border-bottom-color: var(--brand);
}
.small {
  font-size: 0.8125rem;
}

.signin {
  max-width: 30rem;
  margin: 15vh auto;
  padding: 0 1.5rem;
}
.signin h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
.signin ul {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 0.5rem;
}
.signin button {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 0.15rem;
  cursor: pointer;
  padding: 0.75rem 1rem;
  font: inherit;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.signin button:hover {
  border-color: var(--brand);
}
.signin button span {
  color: var(--muted-foreground);
  font:
    12px ui-monospace,
    monospace;
}
.bar .who {
  margin-left: auto;
  color: var(--muted-foreground);
}
.bar .who button {
  font: inherit;
  color: var(--brand);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.linkish {
  font: inherit;
  color: var(--brand);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ---- editing, in a session ---- */
.editshell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.editshell > .editbody {
  flex: 1;
}
.editshell .bar {
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.bar__doc b {
  color: var(--foreground);
}
.bar__actions {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.bar button {
  font: inherit;
  padding: 0.25rem 0.6rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
  cursor: pointer;
}
.bar button.primary,
.dialog .primary,
.meta .primary {
  background: var(--brand);
  color: var(--background);
  border-color: transparent;
}
.bar button:disabled {
  opacity: 0.45;
  cursor: default;
}
.roster {
  display: flex;
  gap: 0.3rem;
}
.roster__who {
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--peer, var(--border));
  color: var(--foreground);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
/* The same colour as that person's cursor in the text, so the two are recognisably one. */
.roster__who::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--peer, var(--muted-foreground));
}
.saved {
  color: var(--muted-foreground);
}
.saved--no {
  color: var(--brand);
}
.target b {
  color: var(--foreground);
}
.banner {
  padding: 0.6rem 1rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.banner button {
  font: inherit;
  padding: 0.2rem 0.6rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
  cursor: pointer;
}
.banner--warn {
  background: color-mix(in oklch, var(--brand) 14%, var(--background));
}
.banner--ok {
  background: color-mix(in oklch, var(--accent) 60%, var(--background));
}
.banner--err {
  background: color-mix(in oklch, var(--destructive) 18%, var(--background));
}
.editbody {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}
.editbody--details {
  grid-template-columns: 1fr 22rem;
}
.editbody .editing {
  height: auto;
  min-height: 0;
  overflow: auto;
}

/* The editor's comments: the same threads as the reader's, in a column beside the text. */
.ecomments {
  border-left: 1px solid var(--border);
  padding: 1rem 1.25rem;
  overflow: auto;
  background: var(--card);
  font-size: 0.875rem;
}
.ecomments__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}
.ecomments__item {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}
.ecomments__item.is-active {
  box-shadow: inset 3px 0 0 var(--brand);
  padding-left: 0.75rem;
}
.ecomments__quote {
  all: unset;
  display: block;
  cursor: pointer;
  font-style: italic;
  color: var(--foreground);
  border-left: 2px solid color-mix(in oklab, var(--brand) 55%, transparent);
  padding-left: 0.5rem;
  margin-bottom: 0.4rem;
}
.ecomments__quote:disabled {
  cursor: default;
  color: var(--muted-foreground);
}

.meta {
  border-left: 1px solid var(--border);
  padding: 1.25rem;
  overflow: auto;
  background: var(--card);
  display: grid;
  gap: 1rem;
  align-content: start;
  font-size: 0.875rem;
}
.meta h2 {
  margin: 0;
  font-size: 1rem;
}
.meta label {
  display: grid;
  gap: 0.3rem;
}
.meta input:not([type]),
.meta input[type='text'],
.meta select,
.dialog input:not([type='radio']) {
  font: inherit;
  padding: 0.4rem 0.5rem;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 4px);
}
.meta__check {
  grid-template-columns: auto 1fr;
  align-items: start;
}
.meta__check .small {
  grid-column: 2;
}
.meta__actions {
  display: flex;
  gap: 0.5rem;
}
.meta button,
.dialog button {
  font: inherit;
  padding: 0.35rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
  cursor: pointer;
}
.meta__problem {
  color: var(--destructive);
}

.dialog {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in oklch, var(--background) 70%, transparent);
  z-index: 20;
}
.dialog form {
  width: min(32rem, calc(100vw - 2rem));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
  font-size: 0.875rem;
}
.dialog h2 {
  margin: 0;
  font-size: 1.1rem;
}
.dialog fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.dialog fieldset label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.5rem;
  align-items: start;
}
.dialog fieldset label > :not(input[type='radio']):not(:nth-child(2)) {
  grid-column: 2;
}
.dialog .is-disabled {
  opacity: 0.5;
}
.dialog label {
  display: grid;
  gap: 0.3rem;
}
.dialog__actions {
  display: flex;
  gap: 0.5rem;
}

/* ---- the app bar ---- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 0.6rem 1.25rem;
  background: color-mix(in oklab, var(--card) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  font-size: 0.8125rem;
}
.appbar a {
  color: var(--muted-foreground);
  text-decoration: none;
}
.appbar__home {
  font:
    600 14px ui-monospace,
    monospace;
  color: var(--foreground) !important;
}
.appbar__middle {
  flex: 1;
}
.appbar__collection {
  color: var(--foreground) !important;
  font-weight: 600;
}
.appbar__collection::before {
  content: '/';
  margin-right: 1.25rem;
  color: var(--border);
  font-weight: 400;
}
.switcher {
  position: relative;
}
/* The slash sits outside the button, so it is not part of what highlights. */
.switcher::before {
  content: '/';
  margin-right: 1.25rem;
  color: var(--border);
}
.switcher .appbar__collection::before {
  content: none;
}
.switcher__button {
  all: unset;
  cursor: pointer;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  margin-left: -0.4rem;
  border-radius: var(--radius);
}
.switcher__button:hover,
.switcher__button[aria-expanded='true'] {
  background: var(--muted, color-mix(in oklab, var(--foreground) 8%, transparent));
}
.switcher__button:focus-visible {
  outline: 2px solid var(--brand);
}
.switcher__menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: -0.4rem;
  z-index: 20;
  min-width: 16rem;
  max-width: 22rem;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
}
.switcher__menu a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--foreground) !important;
}
.switcher__menu a:hover {
  background: color-mix(in oklab, var(--foreground) 8%, transparent);
}
.switcher__menu a.is-current {
  box-shadow: inset 2px 0 0 var(--brand);
}
.switcher__desc {
  display: block;
  margin-top: 0.15rem;
}
.appbar__new {
  color: var(--brand) !important;
}
.appbar__who {
  color: var(--muted-foreground);
}

/* ---- home ---- */
.home {
  max-width: 76rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
@media (min-width: 64rem) {
  .home {
    grid-template-columns: minmax(0, 1fr) 22rem;
  }
}
.home__search {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.25rem;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: var(--radius);
}
.home__newhere {
  margin-top: 1rem;
  font-size: 0.875rem;
}
.home__side section {
  margin-bottom: 2rem;
}
.hits {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hits li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.hits .rfd__state {
  margin-left: 0.5rem;
}
.hits__snippet {
  margin: 0.3rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.feed {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}
.feed li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.feed__warn {
  color: var(--brand);
  font-weight: 600;
}

/* ---- {% example %}: as written, and as rendered ---- */
.example {
  margin: 1.5rem 0;
}
.example__title {
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.example__panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 56rem) {
  .example__panes {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  /* A chart needs the width: shown under its source rather than beside it. */
  .example__panes:has(.chart) {
    grid-template-columns: minmax(0, 1fr);
  }
  .example__panes:has(.chart) .example__pane + .example__pane {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .example__pane + .example__pane {
    border-left: 1px solid var(--border);
  }
}
.example__pane {
  min-width: 0;
}
.example__label {
  padding: 0.4rem 0.9rem;
  font:
    500 11px ui-monospace,
    monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}
.rfd__body .example__source {
  margin: 0;
  border: 0;
  border-radius: 0;
  white-space: pre-wrap;
}
.example__result {
  padding: 0.25rem 1rem;
}

/* ---- {% chart %} ---- */
.chart {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.chart__head,
.chart__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}
.chart__title {
  font-weight: 600;
}
.chart .seg button {
  padding: 0.2rem 0.7rem;
}
.chart__svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.75rem 0;
}
.chart__grid {
  stroke: var(--border);
  stroke-width: 1;
}
.chart__axis {
  fill: var(--muted-foreground);
  font-size: 11px;
}
.chart__hover {
  fill: color-mix(in oklab, var(--foreground) 6%, transparent);
}
.chart__bar {
  transition: opacity 0.15s;
}
.chart__line {
  fill: none;
  stroke-width: 2.5;
}
.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chart__legend button {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.chart__legend button.is-off {
  opacity: 0.4;
  text-decoration: line-through;
}
.chart__legend i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
}
.chart__readout {
  font-size: 0.8125rem;
}
.chart__data {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}
.chart__data summary {
  cursor: pointer;
  color: var(--muted-foreground);
}

/* ---- mentions ---- */
.mention {
  display: inline-block;
  padding: 0 0.35em;
  border-radius: 0.6em;
  font-weight: 500;
  color: var(--foreground);
  background: color-mix(in oklab, #58a6ff 18%, transparent);
  white-space: nowrap;
}
/* Mentioning the person reading: the one they should notice. */
.mention--you {
  color: #0b0b0c;
  background: var(--brand);
}
.composer__field {
  position: relative;
}
.composer__field textarea {
  width: 100%;
  box-sizing: border-box;
}
.mention-picker {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  margin: 0.25rem 0 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
  font-size: 0.8125rem;
}
.mention-picker li {
  padding: 0.35rem 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}
.mention-picker li.is-picked,
.mention-picker li:hover {
  background: color-mix(in oklab, var(--foreground) 10%, transparent);
}

/* ---- a raw file ---- */
.raw {
  max-width: 96rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 6rem;
}
.raw__head {
  margin-bottom: 1rem;
}
.raw__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 64rem) {
  .raw__body {
    grid-template-columns: minmax(0, 1fr) 24rem;
  }
  .raw__side {
    position: sticky;
    top: 4rem;
    max-height: calc(100vh - 5rem);
    overflow: auto;
  }
}
.raw__code {
  /* Code as typed: a ligature turns `</` into one glyph, which is not what the file says. */
  font-variant-ligatures: none;
  font:
    13px/1.6 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0;
  overflow-x: auto;
}
.raw__line {
  display: grid;
  grid-template-columns: 3.5rem 1rem 1fr;
}
.raw__line.is-commented {
  background: color-mix(in oklab, var(--brand) 7%, transparent);
}
.raw__line.is-lit {
  background: color-mix(in oklab, var(--brand) 20%, transparent);
}
.raw__line.is-chosen {
  background: color-mix(in oklab, #58a6ff 22%, transparent);
}
.raw__no {
  all: unset;
  cursor: pointer;
  text-align: right;
  padding-right: 0.75rem;
  color: var(--muted-foreground);
  opacity: 0.6;
  user-select: none;
}
.raw__no:hover {
  opacity: 1;
  color: var(--foreground);
}
.raw__mark {
  display: flex;
  align-items: center;
}
.raw__dot {
  all: unset;
  cursor: pointer;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--brand);
}
.raw__text {
  white-space: pre;
  padding-right: 1rem;
}
.raw__side {
  font-size: 0.875rem;
}
.raw__compose {
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.raw__quote {
  margin: 0.25rem 0 0.5rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  white-space: pre-wrap;
  background: color-mix(in oklab, #f85149 10%, transparent);
  border-left: 2px solid color-mix(in oklab, #f85149 55%, transparent);
}

/* ---- a document's history ---- */
.history {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
}

.diff {
  margin-top: 0.6rem;
}
.diff__added {
  color: #3fb950;
}
.diff__removed {
  color: #f85149;
}
.diff__hunk {
  margin: 0 0 0.6rem;
  padding: 0.25rem 0;
  overflow-x: auto;
  font-size: 0.75rem;
  line-height: 1.5;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.diff__line {
  display: grid;
  grid-template-columns: 2.5rem 2.5rem 1.25rem 1fr;
  white-space: pre-wrap;
  word-break: break-word;
}
.diff__line--added {
  background: color-mix(in oklab, #3fb950 16%, transparent);
}
.diff__line--removed {
  background: color-mix(in oklab, #f85149 16%, transparent);
}
.diff__no {
  padding-right: 0.5rem;
  text-align: right;
  color: var(--muted-foreground);
  opacity: 0.6;
  user-select: none;
}
.diff__mark {
  color: var(--muted-foreground);
  user-select: none;
}

/* ---- new document ---- */
.newdoc {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.newdoc form {
  display: grid;
  gap: 1rem;
}
.newdoc label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.875rem;
}
.newdoc input,
.newdoc select {
  font: inherit;
  padding: 0.5rem 0.6rem;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 4px);
}
.newdoc button {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border-radius: calc(var(--radius) - 4px);
  border: 0;
  background: var(--brand);
  color: var(--background);
  cursor: pointer;
}
.newdoc button:disabled {
  opacity: 0.45;
}

/* ---- comments, where they are about ---- */
.rfd__stage {
  position: relative;
  grid-column: 1;
}
.rfd__stage .rfd__body {
  grid-column: auto;
}
.cmark {
  position: absolute;
  z-index: 3;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 0.75rem 0.75rem 0.75rem 0.2rem;
  border: 1px solid var(--brand);
  background: var(--card);
  color: var(--brand);
  font:
    600 11px/1 ui-monospace,
    monospace;
  cursor: pointer;
  transform: translateY(0.1rem);
}
.cmark[data-active],
.cmark:hover {
  background: var(--brand);
  color: var(--background);
}
.cpop__offer {
  position: absolute;
  z-index: 5;
  transform: translateX(-50%);
  font:
    600 12px system-ui,
    sans-serif;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 0;
  background: var(--brand);
  color: var(--background);
  cursor: pointer;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.35);
}
.cpop {
  position: absolute;
  z-index: 6;
  box-sizing: border-box;
  width: 22rem;
  max-width: 100%;
  padding: 0.85rem;
  background: var(--popover, var(--card));
  color: var(--popover-foreground, var(--foreground));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.45);
  font-size: 0.8125rem;
}
.cpop blockquote {
  margin: 0 0 0.5rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--brand);
  color: var(--muted-foreground);
  font-style: italic;
}
.composer textarea {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  padding: 0.5rem;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 4px);
}
.composer button,
/* A thread being resolved: still readable, plainly on its way out. */
.thread.is-resolving {
  opacity: 0.55;
  transition: opacity 0.2s;
}
.thread.is-resolving .composer {
  pointer-events: none;
}
.thread__resolve {
  margin: 0.4rem 0.4rem 0 0;
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.25rem 0.65rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
  cursor: pointer;
}
.composer button.primary {
  background: var(--brand);
  color: var(--background);
  border-color: transparent;
}
.composer button:disabled {
  opacity: 0.45;
  cursor: default;
}
.thread__msg {
  margin: 0 0 0.6rem;
}
.thread__resolve {
  border: 0;
  background: none;
  color: var(--brand);
  padding: 0;
}
.discussion {
  grid-column: 1;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 44rem;
}
.discussion h2 {
  font-size: 1rem;
}
.discussion__thread {
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 0.875rem;
}
.cpanel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: min(24rem, 100vw);
  overflow: auto;
  padding: 1rem;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgb(0 0 0 / 0.35);
}
.cpanel header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cpanel h2 {
  font-size: 1rem;
  margin: 0 0 1rem;
}
.cpanel__item {
  display: grid;
  gap: 0.3rem;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--foreground);
  padding: 0.7rem;
  margin-bottom: 0.6rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.cpanel__item:hover {
  border-color: var(--brand);
}
.cpanel__item--done {
  cursor: default;
  opacity: 0.7;
}
.cpanel__quote {
  color: var(--muted-foreground);
  font-style: italic;
}

/* ---- the editor's own bits ---- */
.sessionline {
  padding: 0.35rem 1rem;
  border-bottom: 1px solid var(--border);
  font:
    11px ui-monospace,
    monospace;
}
.sessionline b {
  color: var(--foreground);
}
.seg {
  display: inline-flex;
}
.seg button {
  border-radius: 0;
}
.seg button:first-child {
  border-radius: calc(var(--radius) - 4px) 0 0 calc(var(--radius) - 4px);
}
.seg button:last-child {
  border-radius: 0 calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0;
  border-left: 0;
}
.seg button[aria-selected='true'] {
  background: var(--accent);
  color: var(--accent-foreground);
}
.preview {
  overflow: auto;
  padding: 2rem clamp(1rem, 5vw, 4rem) 40vh;
  min-height: 0;
}
.preview .rfd__body {
  max-width: 48rem;
  margin: 0 auto;
}
.editing[hidden] {
  display: none;
}
