:root {
  --paper: #fbf8f1;
  --ink: #23201c;
  --muted: #7a7266;
  --line: #e7e0d2;
  --accent: #e4572e;
  --c1: #d63031; --c2: #d35400; --c3: #1e8f52; --c4: #2d6cdf; --c5: #8e44ad; --c6: #d6307e;
  --mark: #ffe98a;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #efe9dc; color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; margin-right: auto; }
.logo .wm span { color: var(--accent); }
.here-wrap { position: relative; }
.here { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font-size: 14px; }
.here i { font-style: normal; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #20a464; box-shadow: 0 0 0 3px #20a46422; }
.offline .dot { background: #bbb; box-shadow: none; }
.peers { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 8px; min-width: 200px; max-height: 50vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px #0002; font-size: 14px; }
.peers li { padding: 4px 6px; display: flex; align-items: center; gap: 8px; }
.peers li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c, #ccc); }
.peers small { color: var(--muted); }
.share { flex: none; border: 0; background: var(--ink); color: #fff; border-radius: 99px; padding: 6px 14px; font-weight: 600; font-size: 14px; }
.toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: #fffdf8ee; backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.tb { min-width: 38px; height: 38px; border: 1px solid transparent; background: none; border-radius: 9px; font-size: 17px; font-family: Georgia, serif; }
.tb[aria-pressed="true"] { background: #23201c12; border-color: #23201c22; }
.tb .mark { background: var(--mark); padding: 0 3px; border-radius: 3px; font-family: system-ui, sans-serif; font-size: 14px; }
.sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; flex: none; }
.swatches { display: flex; align-items: center; }
.tb-c { display: none; }
.tb-c .ca { display: inline-block; font-weight: 700; border-bottom: 4px solid var(--cur, var(--ink)); line-height: 1.1; padding: 0 2px; }
@media (max-width: 559px) {
  .tb-c { display: inline-block; }
  .swatches { display: none; position: absolute; top: calc(100% + 4px); left: 10px; gap: 4px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 30px #0002; }
  .swatches.open { display: flex; }
  .sw { width: 32px; height: 32px; }
}
.sw { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0002; margin: 0 2px; background: var(--ink); }
.sw[data-c="1"] { background: var(--c1); } .sw[data-c="2"] { background: var(--c2); } .sw[data-c="3"] { background: var(--c3); }
.sw[data-c="4"] { background: var(--c4); } .sw[data-c="5"] { background: var(--c5); } .sw[data-c="6"] { background: var(--c6); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
button:focus-visible { outline: 2px solid var(--c4); outline-offset: 2px; }
main { max-width: 860px; margin: 0 auto; padding: 14px 10px 40px; }
.status { margin: 0 0 8px; min-height: 1.5em; text-align: center; color: var(--muted); font-size: 14px; }
.status:empty { display: none; }
.sheet { position: relative; background: var(--paper); border-radius: 4px; box-shadow: 0 1px 2px #0001, 0 10px 40px #5a4a2a18; }
.paper { min-height: 70vh; padding: 28px 22px 60px; outline: none; font: 19px/1.65 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; white-space: pre-wrap; overflow-wrap: anywhere; caret-color: var(--accent); }
.offline .paper { opacity: .75; }
.paper .ln { min-height: 1.65em; }
.paper .ln.h { font: 700 1.55em/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.02em; margin: .35em 0 .15em; }
.paper.empty .ln:first-child::before { content: "This page is empty. Write the first line: everyone who visits will see it."; color: var(--muted); pointer-events: none; position: absolute; }
.paper .b { font-weight: 700; }
.paper .i { font-style: italic; }
.paper .hl { background: var(--mark); border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.paper .c1 { color: var(--c1); } .paper .c2 { color: var(--c2); } .paper .c3 { color: var(--c3); }
.paper .c4 { color: var(--c4); } .paper .c5 { color: var(--c5); } .paper .c6 { color: var(--c6); }
.paper .fd { opacity: .32; text-decoration: line-through; text-decoration-color: #0005; }
.carets { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.caret { position: absolute; width: 2px; background: var(--c); border-radius: 1px; transition: left .12s, top .12s; }
.caret span { position: absolute; bottom: 100%; left: -1px; white-space: nowrap; font: 600 11px/1 system-ui, sans-serif; color: #fff; background: var(--c); padding: 3px 5px; border-radius: 4px 4px 4px 0; opacity: .0; transition: opacity .3s; }
.caret.talk span, .sheet:hover .caret span { opacity: .95; }
.about { margin: 22px 6px 0; color: #4d463c; font-size: 15px; }
.about summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); max-width: min(92vw, 460px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: .25s; z-index: 30; text-align: center; box-shadow: 0 8px 30px #0003; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 12px 28px; }
.foot a { color: inherit; }
.prose { max-width: 680px; margin: 0 auto; padding: 24px 20px 40px; background: var(--paper); border-radius: 4px; }
.prose h1 { letter-spacing: -.02em; }
.prose h2 { font-size: 18px; margin-top: 1.6em; }
@media (min-width: 700px) {
  main { padding-top: 24px; }
  .paper { padding: 44px 56px 80px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .caret, .toast { transition: none; } }
