/* Releases: the list and the reviewed document. Colours are the site's tokens only, so the light
   theme (style-light.css) re-colours this page with no second stylesheet. */

.rl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 4px 0 16px; }
.rl-head h1 { margin: 0 0 4px; font-size: 22px; }
.rl-sub { margin: 0; color: var(--dim); font-size: 13px; max-width: 760px; }
.rl-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.rl-btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px;
          font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.rl-btn:hover:not(:disabled) { border-color: var(--accent); }
.rl-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.rl-btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.rl-btn:disabled { opacity: .45; cursor: default; }
.rl-btn.small { padding: 3px 9px; font-size: 12px; }
.rl-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 10px; }
.rl-err { color: var(--bad); font-size: 13px; margin-right: auto; }
.rl-dim { color: var(--dim); }
.rl-opt { color: var(--dimmer); font-size: 11px; text-transform: none; letter-spacing: 0; }
.rl-key { font-family: var(--mono); font-size: 11px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.rl-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); border: 1px solid var(--accent-dim);
          border-radius: 4px; padding: 0 4px; margin-right: 6px; }
.rl-pill { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap;
           color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.rl-pill.approved { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.rl-pill.changed_after_approval { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.rl-pill.archived { color: var(--dim); background: var(--panel-2); }
.rl-count { display: inline-block; min-width: 20px; text-align: center; font-size: 12px; font-weight: 600; border-radius: 999px;
            padding: 1px 6px; background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }

.rl-new-grid { display: grid; grid-template-columns: 2fr 1.3fr 1.5fr; gap: 12px; }
@media (max-width: 900px) { .rl-new-grid { grid-template-columns: 1fr; } }
.rl-new label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.rl-new input, .rl-new textarea { font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; }
.rl-new textarea { font-family: var(--mono); font-size: 13px; resize: vertical; }
.rl-md { margin-top: 12px; }

.rl-list-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin-bottom: 8px; }
.rl-list-head a { color: var(--accent); text-decoration: none; }
.rl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rl-table th { text-align: left; font-size: 11px; color: var(--dim); font-weight: 500; text-transform: uppercase; letter-spacing: .04em;
               padding: 6px 10px; border-bottom: 1px solid var(--line); }
.rl-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rl-table tbody tr { cursor: pointer; }
.rl-table tbody tr:hover td { background: var(--panel-2); }
.rl-title { color: var(--text); font-weight: 600; text-decoration: none; }
.rl-empty { color: var(--dim); margin: 8px 0; }
.rl-api summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.rl-api p { font-size: 13px; }
.rl-api a { color: var(--accent); }
.rl-api pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 12px; }

.rl-av { --h: 210; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
         font-size: 10px; font-weight: 700; color: #fff; flex: none; background: hsl(var(--h) 55% 42%); }

/* ── the document page ────────────────────────────────────────────────────────────────────── */
.rd-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; }
.rd-back { color: var(--dim); text-decoration: none; font-size: 13px; }
.rd-back:hover { color: var(--text); }
.rd-titlebar { display: flex; align-items: center; gap: 10px; flex: 1 1 360px; min-width: 0; }
.rd-title { font: inherit; font-size: 20px; font-weight: 650; color: var(--text); background: transparent; border: 1px solid transparent;
            border-radius: 8px; padding: 3px 8px; min-width: 120px; flex: 1 1 auto; }
.rd-title:hover { border-color: var(--line); }
.rd-title:focus { border-color: var(--accent); outline: none; background: var(--panel); }
.rd-approval { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.rd-approval a { color: var(--accent); }
.rd-more { position: relative; }
.rd-more summary { list-style: none; cursor: pointer; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--dim); }
.rd-more summary::-webkit-details-marker { display: none; }
.rd-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
           padding: 6px; z-index: 30; min-width: 180px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.rd-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; font-size: 13px;
                  padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.rd-menu button:hover { background: var(--panel-2); }
.rd-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; padding: 10px 14px; margin-bottom: 12px;
             border-radius: 10px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
             background: color-mix(in srgb, var(--warn) 10%, transparent); }
.rd-banner[hidden] { display: none; }
.rd-banner span { margin-right: auto; }

/* 3.7.3: an approved release is locked until someone unapproves it */
.rd-lock { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; padding: 10px 14px; margin-bottom: 12px;
           border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
           background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rd-lock[hidden] { display: none; }
.rd-lock span { margin-right: auto; }
.rd-tools button:disabled { opacity: .35; cursor: not-allowed; }
.rd-title[readonly] { cursor: default; }

/* 3.7.3: where the release starts and ends */
.rd-range { font-size: 12.5px; color: var(--dim); margin: 2px 0 6px; }
.rd-range code, .rl-ref code { font-size: 12px; background: color-mix(in srgb, var(--line) 45%, transparent);
                               border-radius: 5px; padding: 1px 6px; color: var(--text); }
.rl-ref { white-space: nowrap; }
.rl-btn:disabled[data-act="delete"] { opacity: .4; cursor: not-allowed; }

.rd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .rd-grid { grid-template-columns: 1fr; } }
.rd-main { min-width: 0; }

.rd-toolbar { position: sticky; top: 8px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px;
              flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; margin-bottom: 10px; }
.rd-toolbar[hidden] { display: none; }
.rd-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rd-tools button { background: none; border: 1px solid transparent; color: var(--text); font: inherit; font-size: 13px; min-width: 30px;
                   height: 30px; padding: 0 7px; border-radius: 7px; cursor: pointer; }
.rd-tools button:hover { background: var(--panel-2); }
.rd-tools button.on { background: var(--accent-dim); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.rd-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 5px; }
.rd-save { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.rd-savestate { font-size: 12px; color: var(--dim); white-space: nowrap; }
.rd-savestate.dirty { color: var(--warn); }
.rd-note { font: inherit; font-size: 12px; width: 200px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2);
           border-radius: 7px; padding: 5px 8px; }

.rd-paper { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 36px 56px 48px;
            min-height: 60vh; }
.rd-paper[hidden] { display: none; }
@media (max-width: 700px) { .rd-paper { padding: 20px 16px; } }
.rd-paper .ProseMirror { outline: none; max-width: 780px; margin: 0 auto; font-size: 15px; line-height: 1.65; color: var(--text); }
.rd-paper .ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--dimmer); float: left; height: 0; pointer-events: none; }
.rd-paper h1 { font-size: 26px; margin: 0.6em 0 0.3em; line-height: 1.25; }
.rd-paper h2 { font-size: 20px; margin: 1.1em 0 0.3em; line-height: 1.3; }
.rd-paper h3 { font-size: 16px; margin: 1em 0 0.25em; }
.rd-paper p { margin: 0.45em 0; }
.rd-paper ul, .rd-paper ol { padding-left: 1.5em; margin: 0.4em 0; }
.rd-paper li > p { margin: 0.15em 0; }
.rd-paper blockquote { border-left: 3px solid var(--line-2); margin: 0.6em 0; padding: 0.1em 0 0.1em 1em; color: var(--dim); }
.rd-paper code { font-family: var(--mono); font-size: 0.88em; background: var(--panel-2); border-radius: 4px; padding: 1px 4px; }
.rd-paper pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
.rd-paper pre code { background: none; padding: 0; }
.rd-paper a { color: var(--accent); }
.rd-paper hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.2em 0; }

.rd-hl { background: color-mix(in srgb, var(--warn) 22%, transparent); border-bottom: 2px solid color-mix(in srgb, var(--warn) 70%, transparent);
         cursor: pointer; border-radius: 2px; }
.rd-hl.on { background: color-mix(in srgb, var(--warn) 42%, transparent); }
.rd-hl.pending { background: color-mix(in srgb, var(--accent) 28%, transparent); border-bottom-color: var(--accent); }
.rd-float { position: absolute; right: -14px; z-index: 15; background: var(--accent); color: #fff; border: 0; border-radius: 999px;
            font: inherit; font-size: 12px; padding: 5px 11px; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.rd-float[hidden] { display: none; }

/* the side panel */
.rd-side { position: sticky; top: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
           /* X-ray's top bar scrolls away, so stick to the window top; and stay clear of the ~140px under
              the document (page padding + the Ask dock), or at the page's end the panel's top is cut off */
           max-height: calc(100vh - 150px); display: flex; flex-direction: column; overflow: hidden; }
@media (max-width: 1100px) { .rd-side { position: static; max-height: none; } }
.rd-tabs { display: flex; border-bottom: 1px solid var(--line); }
.rd-tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font: inherit; font-size: 13px;
                  font-weight: 600; padding: 11px 8px; cursor: pointer; }
.rd-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.rd-tabs span { font-weight: 500; color: var(--dim); margin-left: 3px; }
.rd-pane { overflow-y: auto; padding: 12px; flex: 1 1 auto; min-height: 0; }   /* min-height 0: or a long list is clipped, not scrolled */
.rd-pane[hidden] { display: none; }
.rd-empty { color: var(--dim); font-size: 13px; text-align: center; padding: 24px 8px; }
.rd-filter { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.rd-filter button { background: none; border: 0; color: var(--dim); font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer; }
.rd-filter button.on { background: var(--panel-2); color: var(--text); }

.rd-composer { border: 1px solid var(--accent); border-radius: 10px; padding: 10px; margin-bottom: 12px; background: var(--panel-2); }
.rd-composer[hidden] { display: none; }
.rd-composer blockquote, .rd-thread blockquote { margin: 0 0 8px; padding: 2px 0 2px 8px; border-left: 3px solid var(--warn);
  font-size: 12px; color: var(--dim); white-space: pre-wrap; word-break: break-word; }
.rd-composer blockquote { border-left-color: var(--accent); }
.rd-composer textarea, .rd-thread textarea { width: 100%; font: inherit; font-size: 13px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; resize: vertical; }

.rd-thread { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; cursor: pointer;
             transition: border-color .15s, box-shadow .15s; }
.rd-thread:hover { border-color: var(--line-2); }
.rd-thread.on { border-color: var(--warn); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent); }
.rd-thread.resolved { opacity: .8; }
.rd-thread-acts { position: absolute; top: 8px; right: 8px; }
.rd-thread blockquote { margin-right: 84px; }
.rd-gone { font-size: 11px; color: var(--warn); margin: -4px 0 8px; }
.rd-comment { padding: 6px 0; border-top: 1px solid var(--line); }
.rd-thread > .rd-comment:first-of-type { border-top: 0; }
.rd-person { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.rd-name { font-weight: 600; font-size: 13px; }
.rd-body { font-size: 13px; line-height: 1.5; margin: 5px 0 0 31px; white-space: pre-wrap; word-break: break-word; }
.rd-cacts { margin: 3px 0 0 31px; display: flex; gap: 8px; }
.rd-cacts button { background: none; border: 0; padding: 0; color: var(--dim); font: inherit; font-size: 11px; cursor: pointer; }
.rd-cacts button:hover { color: var(--text); }
.rd-resolved-by { font-size: 11px; color: var(--good); margin: 4px 0 0; }
.rd-reply-row { display: flex; gap: 6px; align-items: flex-end; margin-top: 8px; }
.rd-reply-row textarea { flex: 1; }

/* history */
.rd-ev { display: flex; gap: 10px; padding: 9px 6px; border-radius: 8px; font-size: 13px; }
.rd-ev + .rd-ev { border-top: 1px solid var(--line); }
.rd-ev.click { cursor: pointer; }
.rd-ev.click:hover, .rd-ev.on { background: var(--panel-2); }
.rd-ev-ic { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
            font-size: 11px; background: var(--panel-2); color: var(--dim); }
.rd-ev.saved .rd-ev-ic, .rd-ev.created .rd-ev-ic, .rd-ev.restored .rd-ev-ic { background: var(--accent-dim); color: var(--accent); }
.rd-ev.approved .rd-ev-ic { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.rd-ev-main { min-width: 0; flex: 1; }
.rd-ev-note { color: var(--dim); font-size: 12px; margin-top: 2px; word-break: break-word; }
.rd-ev-meta { font-size: 12px; margin-top: 3px; color: var(--dim); }
.rd-ev-time { font-size: 11px; margin-top: 2px; }
.rd-plus { color: var(--good); font-variant-numeric: tabular-nums; margin-right: 4px; }
.rd-minus { color: var(--bad); font-variant-numeric: tabular-nums; }

/* a version opened from history */
.rd-version[hidden] { display: none; }
.rd-vhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; background: var(--panel);
            border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.rd-vtitle { font-weight: 650; font-size: 16px; }
.rd-vmeta { font-size: 12px; color: var(--dim); margin-top: 3px; }
.rd-vactions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rd-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.rd-seg button { background: none; border: 0; color: var(--dim); font: inherit; font-size: 12px; padding: 6px 10px; cursor: pointer; }
.rd-seg button.on { background: var(--panel-2); color: var(--text); }
.rd-vsum { font-size: 13px; margin: 0 2px 10px; color: var(--dim); }
.rd-vbody { min-height: 40vh; font-size: 15px; line-height: 1.65; }
.rd-vbody > * { max-width: 780px; margin-left: auto; margin-right: auto; }
.rd-d.li { padding-left: 1.6em; position: relative; margin: 0.15em auto; }
.rd-d.li::before { content: "•"; position: absolute; left: 0.6em; color: var(--dim); }
.rd-d.add { background: color-mix(in srgb, var(--good) 13%, transparent); box-shadow: inset 3px 0 0 var(--good); }
.rd-d.del { background: color-mix(in srgb, var(--bad) 12%, transparent); box-shadow: inset 3px 0 0 var(--bad);
            text-decoration: line-through; color: var(--dim); }
.rd-d.change { box-shadow: inset 3px 0 0 var(--warn); }
.rd-d.add:not(.li), .rd-d.del:not(.li), .rd-d.change:not(.li) { padding-left: 10px; }
.rd-d.same { color: var(--dim); }
.rd-vbody ins { background: color-mix(in srgb, var(--good) 28%, transparent); color: var(--text); text-decoration: none; border-radius: 2px; }
.rd-vbody del { background: color-mix(in srgb, var(--bad) 25%, transparent); color: var(--dim); border-radius: 2px; }

.rd-modal { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.rd-modal[hidden] { display: none; }
.rd-modal-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 20px; max-width: 520px; width: 100%; }
.rd-modal-card h3 { margin: 0 0 8px; font-size: 16px; }
.rd-modal-card p { margin: 0; color: var(--dim); font-size: 13px; line-height: 1.5; }
.rd-modal-card .rl-actions { flex-wrap: wrap; margin-top: 16px; }
.rd-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 110; background: var(--panel-2); color: var(--text);
            border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 16px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.rd-toast[hidden] { display: none; }
.rl-btn.danger { color: var(--bad); }
.rl-btn.danger:hover:not(:disabled) { border-color: var(--bad); }
.rl-row-acts { white-space: nowrap; text-align: right; }
.rl-row-acts .rl-btn + .rl-btn { margin-left: 6px; }
.rd-menu button.danger { color: var(--bad); }
@keyframes rd-flash { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 70%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.rd-flash { animation: rd-flash 1.2s var(--ease-out); }
/* the site's keyboard-focus ring frames controls; around a whole document it reads as a selection box */
.rd-paper .ProseMirror:focus, .rd-paper .ProseMirror:focus-visible { outline: none; box-shadow: none; }
/* ...and over the light theme's `:root:not([data-theme="dark"]) :focus-visible`, which ties with the rule above and loads later */
#rd-paper .ProseMirror:focus, #rd-paper .ProseMirror:focus-visible { outline: none; box-shadow: none; }
.rd-drafts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.rd-drafts[hidden] { display: none; }
.rd-chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding: 3px 3px 8px;
             scrollbar-width: thin; overscroll-behavior-x: contain; }
.rd-chip { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
           background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px;
           padding: 7px 12px; font: inherit; max-width: 320px; }
.rd-chip:hover { border-color: var(--accent); }
.rd-chip.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
              background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.rd-chip.draft { border-style: dashed; }
.rd-chip.draft.on { border-style: solid; }
.rd-chip-t { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.rd-chip-s { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 290px; }
.rd-badge { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; padding: 1px 7px;
            color: var(--dim); background: var(--panel-2); }
.rd-badge.active { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.rd-drafts-count { font-size: 12px; color: var(--dim); }
.rd-drafts-count b { color: var(--text); }
.rd-drafts-count a { color: var(--accent); }
.rd-ev.drafted .rd-ev-ic { background: var(--accent-dim); color: var(--accent); }
.rd-hl.resolved { background: color-mix(in srgb, var(--good) 22%, transparent); border-bottom-color: color-mix(in srgb, var(--good) 70%, transparent); }
.rd-chip.prev { opacity: .85; }
.rd-chip.draft.dismissed { opacity: .7; }
.rd-badge.waiting { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.rd-chips-wrap { position: relative; min-width: 0; }
.rd-scroll { position: absolute; top: 3px; bottom: 8px; z-index: 2; width: 30px; border: 1px solid var(--line-2); border-radius: 10px;
             background: var(--panel-2); color: var(--text); font-size: 18px; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.rd-scroll.left { left: 0; }
.rd-scroll.right { right: 0; }
.rd-scroll[hidden] { display: none; }

/* ── 3.7.7: live co-editing — who is here, their carets, the connection ───────────────────────── */
.rd-live { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -2px 0 12px; padding: 6px 10px; font-size: 12.5px;
            background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
            position: relative; z-index: calc(var(--z-dropdown) + 1); }   /* its "+N" menu opens over the sticky toolbar */
.rd-live[hidden] { display: none; }
.rd-conn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.rd-conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dimmer); }
.rd-conn[data-state="saved"], .rd-conn[data-state="saving"] { color: var(--good); }
.rd-conn[data-state="saved"]::before, .rd-conn[data-state="saving"]::before { background: var(--good);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.rd-conn[data-state="offline"], .rd-conn[data-state="slow"] { color: var(--warn); }
.rd-conn[data-state="offline"]::before, .rd-conn[data-state="slow"]::before { background: var(--warn); }
.rd-presence { display: flex; align-items: center; gap: 2px; }
.rd-pav { --c: #888; width: 30px; height: 30px; border-radius: 50%; margin-left: -6px; border: 2px solid var(--bg); padding: 0;
          background: var(--c); color: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; position: relative;
          transition: transform .15s var(--ease-out), opacity .2s; }
.rd-presence > .rd-pav:first-of-type, .rd-pyou + .rd-pav { margin-left: 4px; }
.rd-pav:hover, .rd-pav:focus-visible { transform: translateY(-2px); z-index: 1; }
.rd-pav.viewing { opacity: .6; }
.rd-pav.following { box-shadow: 0 0 0 2px var(--c); }
/* the state dot: green while editing, pulsing while typing, none when only reading */
.rd-pav.editing::after, .rd-pav.typing::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--good); border: 2px solid var(--bg); }
.rd-pav.typing::after { animation: rd-pulse 1s infinite; }
@keyframes rd-pulse { 50% { transform: scale(.6); } }
/* you: first, labelled, and greyed while the page is reconnecting */
.rd-pyou { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; border-radius: 999px;
           background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.rd-pyou .rd-pav { margin-left: 0; width: 26px; height: 26px; cursor: default; opacity: 1; }
.rd-pyou .rd-pav.away { filter: grayscale(1); opacity: .55; }
.rd-pyou .rd-pav:hover { transform: none; }
.rd-pyou-t { font-size: 12px; font-weight: 600; color: var(--text); }
.rd-pmore { position: relative; margin-left: 4px; }
.rd-pmore summary { list-style: none; cursor: pointer; min-width: 30px; height: 30px; border-radius: 15px; padding: 0 8px; display: inline-flex;
                    align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--text);
                    background: var(--panel-2); border: 1px solid var(--line-2); }
.rd-pmore summary::-webkit-details-marker { display: none; }
.rd-pmenu { position: absolute; left: 0; top: calc(100% + 6px); z-index: var(--z-dropdown); min-width: 240px; max-height: 320px; overflow-y: auto;
            background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.rd-prow { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); font: inherit;
           font-size: 13px; padding: 5px 8px; border-radius: 7px; cursor: pointer; text-align: left; }
.rd-prow:hover { background: var(--panel-2); }
.rd-prow .rd-pav { margin: 0; width: 24px; height: 24px; font-size: 9.5px; flex: none; }
.rd-prow .rl-dim { margin-left: auto; font-size: 12px; }
.rd-psum { color: var(--dim); }
.rd-psum.typing { color: var(--text); }
.rd-copylink { margin-left: auto; }
.rd-follow { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 12px; margin-bottom: 10px; border-radius: 10px;
             border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rd-follow[hidden] { display: none; }
.rd-savestate[data-state="saved"] { color: var(--dim); }
.rd-savestate[data-state="saved"]::before { content: "✓ "; color: var(--good); }

/* someone else's caret and selection, in their colour, with their name over the caret */
.rd-caret { --c: #888; position: relative; margin: 0 -1px; border-left: 2px solid var(--c); word-break: normal; }
.rd-caret::before { content: ""; position: absolute; left: -5px; right: -5px; top: 0; bottom: 0; }      /* something to hover */
.rd-caret-label { position: absolute; left: -2px; bottom: 100%; padding: 1px 6px; border-radius: 4px 4px 4px 0; background: var(--c); color: #fff;
                  font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; user-select: none; pointer-events: none;
                  font-family: var(--sans); font-style: normal; transition: opacity .4s; }
.rd-caret.idle .rd-caret-label { opacity: 0; }
.rd-caret:hover .rd-caret-label { opacity: 1; }      /* the name comes back on the caret itself, not on the whole page */
.rd-sel { background: color-mix(in srgb, var(--c) 28%, transparent); }
.rd-by { --c: #888; background: color-mix(in srgb, var(--c) 18%, transparent); border-bottom: 2px solid color-mix(in srgb, var(--c) 70%, transparent); }
.rd-authors.on { background: var(--accent-dim); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.rd-eds { display: inline-flex; margin-left: 6px; vertical-align: middle; }
.rd-eds .rl-av { width: 18px; height: 18px; font-size: 8px; margin-left: -4px; border: 1px solid var(--panel); }
@media (max-width: 700px) {
  .rd-live { gap: 8px; }
  .rd-copylink { margin-left: 0; }
  /* the save row wraps instead of pushing the toolbar (and the page) wider than the phone */
  .rd-save { flex-wrap: wrap; width: 100%; margin-left: 0; }
  .rd-savestate { white-space: normal; flex: 1 1 100%; }
  .rd-note { flex: 1 1 120px; width: auto; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .rd-pav.typing::after { animation: none; } .rd-caret-label { transition: none; } }

/* release truth (wheresit.py): the "Is it in production?" box, its answer, and a release's what-went-in.
   Additive: the site's input (.lr-input), buttons, cards, tables and pills; these only lay them out. */
.wi-box { display: flex; flex-direction: column; gap: 6px; }
.wi-row { display: flex; gap: 8px; align-items: center; }
.wi-row .lr-input { flex: 1 1 auto; }
.wi-answer { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.45; }
.wi-note { margin: 6px 0 0; font-size: 12.5px; }
.wi-note a, .wi-table a, .wi-sub a { color: var(--accent); text-decoration: none; }
.wi-scroll { overflow-x: auto; }
.wi-table tbody tr { cursor: default; }
.wi-table td { vertical-align: top; }
.wi-change { min-width: 280px; }
.wi-sub { font-size: 12px; margin-top: 3px; }
.wi-svc { white-space: nowrap; margin-bottom: 4px; }
.wi-went { margin-top: 16px; }
.wi-title { margin: 0 0 4px; font-size: 17px; }
.wi-h { font-size: 13.5px; margin: 16px 0 6px; }
.wi-delta-repo + .wi-delta-repo { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.rl-pill.yes { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.rl-pill.no { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.rl-pill.maybe { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.rl-pill.unknown { color: var(--dim); background: var(--panel-2); }
.wi-table .rl-key { white-space: nowrap; }
