/* Кооперативный пост (rift_coop.php, rift-coop.js). A new element, like the chat: its colours are each design's chat
   palette (--rift-chat-*, designs.json); the pieces' text is a post's (.post_body), so every post style applies.
   The pieces make one sheet (--rift-chat-input, the palette's writing surface); their comments stand in the margin to
   the right, as in Google Docs (owner 2026-11-18), and go under the piece when the document is narrow. */
/* The topic's entry beside «Эпизод · участники и очередь» (rift_coop_entry): its form stands in the same row. */
.rift-coop-entry{display:inline}
/* Its buttons that read as links (class rift-coop-link): on the old themes' exclusion list of form rules (designs/*.css,
   tools/build_design_variants.py OWN_LOOK), so no design draws them as buttons. */
/* A hidden control stays hidden: buttons.css gives every form button inline-block (body[data-rift-view] #container …). */
body[data-rift-view] #container .rift-coop [hidden],.rift-coop-dialog [hidden]{display:none}
.rift-coop{max-width:1180px;margin:0 auto;padding:0 8px 24px;box-sizing:border-box}
.rift-coop-doc{container-type:inline-size}
.rift-coop :is(.rift-coop-cut,.rift-coop-create,.rift-coop-prefs,.rift-coop-bin,.rift-coop-note){border:1px solid var(--rift-chat-line);border-radius:6px;background:var(--rift-chat-surface);color:var(--rift-chat-text);padding:10px 12px;margin:10px 0}
/* The document's name: not an h2, which the old themes draw as a category bar 500px wide. */
.rift-coop-title{font-weight:bold;font-size:1.3em;margin:10px 0 6px;overflow-wrap:anywhere}
.rift-coop-title small{color:var(--rift-chat-muted);font-weight:normal}
.rift-coop-intro,.rift-coop-hint{color:var(--rift-chat-muted)}
.rift-coop-people{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;margin:6px 0}
.rift-coop-person{display:inline-flex;gap:6px;align-items:center;color:inherit;text-decoration:none}
.rift-coop-person img{width:32px;height:32px;border-radius:50%;object-fit:cover;flex:none}
.rift-coop-person span{font-weight:bold}
.rift-coop-mode{color:var(--rift-chat-muted);margin-left:-8px}
.rift-coop-docs{list-style:none;padding:0}
.rift-coop-docs li{padding:8px 0;border-bottom:1px solid var(--rift-chat-line)}
.rift-coop-doc-link{font-weight:bold}
.rift-coop-create label,.rift-coop-prefs label{display:block;margin:6px 0}
.rift-coop-create .textbox{width:100%;max-width:480px;box-sizing:border-box}
.rift-coop-create fieldset{border:1px solid var(--rift-chat-line);border-radius:5px}
.rift-coop-choice{display:inline-block;margin-right:14px}
.rift-coop-prefs{display:flex;flex-wrap:wrap;gap:6px 18px;align-items:center}
.rift-coop-prefs label{margin:0}
.rift-coop-tools{margin:6px 0}
.rift-coop-link{background:none;border:0;padding:2px 4px;color:var(--rift-chat-accent);cursor:pointer;text-decoration:underline;font:inherit}

/* The sheet (owner 2026-11-19: one sheet, as in Google Docs) is drawn on a post's own markup (rift_coop_doc_html:
   .post.classic, author track, .post_content, .rift-source-post-box), so the design gives its text the post's exact width
   and lines (owner 2026-11-18). It is a bubble of the forum's body colour (the chat palette's surface colour, without its
   texture); its padding is a spread shadow of that colour, so it adds no width. Around it the forum's backdrop, on the
   page and in the topic, in every design: the backdrop the chat copies into --rift-chat-page-* (rift-chat.js), as the
   chat's feed does; it reaches the forum body's edges (rift-coop.js bleed: --rift-coop-bleed-left/right), so no strip
   of the body stays at its sides, and its padding gives that back. The author's column, placed to the right, holds the
   comments instead of the mini profile. */
.rift-coop-row.post{margin:0;background:none;border:0;box-shadow:none}
/* The author's column without the mini profile's frame: the designs paint it with body[data-rift-view]:is(.basic,.sylv).basic
   #container .post .post_author (1,5,1), the mobile one with mobile-showthread.css …:is(…):is(…) #content .post.classic
   .post_author (1,6,1: 95px for the avatar, a dark plate, a shift down); this outweighs them by its own classes (1,7,1),
   and its padding, which the mobile design sets !important, by !important too.
   Not sticky: each card stands at the height of its text (rift-coop.js place). */
body[data-rift-view] #container .rift-coop .rift-coop-sheet .rift-coop-row.post :is(.rift-author-track,.post_author.rift-coop-side){position:static;top:auto;background:none;border:0;border-image:none;border-radius:0;box-shadow:none;min-height:0;padding:0!important;margin:0;width:auto}
/* Nor the light design's frame drawn over it (author-frame.png on .post_author::before) or any other ornament. */
body[data-rift-view] #container .rift-coop .rift-coop-row.post :is(.rift-author-track,.post_author.rift-coop-side,.post_content,.rift-source-post-box)::before,body[data-rift-view] #container .rift-coop .rift-coop-row.post :is(.rift-author-track,.post_author.rift-coop-side,.post_content)::after{content:none}
/* Text on the left at a published post's text width (rift-coop.js --rift-coop-text), the comments to its right in the
   rest of the row (owner 2026-11-18: comments to the right, as in Google Docs); stacked under it when narrow. Over the
   shared post grid (states.css) and the post's own placement of its author column. */
body[data-rift-view] #container .rift-coop-sheet:not([data-stack]) .rift-coop-row.post.classic{grid-template-columns:var(--rift-coop-text,minmax(0,1fr)) minmax(0,1fr)}
body[data-rift-view] #container .rift-coop-sheet:not([data-stack]) .rift-coop-row.post.classic>.post_content{grid-column:1;grid-row:1}
body[data-rift-view] #container .rift-coop .rift-coop-sheet:not([data-stack]) .rift-coop-row.post.classic>.rift-author-track{grid-column:2;grid-row:1;margin-left:var(--rift-coop-bubble-pad)}
body[data-rift-view] #container .rift-coop-sheet[data-stack] .rift-coop-row.post.classic{grid-template-columns:minmax(0,1fr)}
body[data-rift-view] #container .rift-coop-sheet[data-stack] .rift-coop-row.post.classic>*{grid-column:1;grid-row:auto}
/* Under the sheet the comments take the sheet's whole width, whatever way the design lays the post out (the mobile one
   makes it a flex row). */
body[data-rift-view] #container .rift-coop .rift-coop-sheet[data-stack] .rift-coop-row.post{flex-wrap:wrap}
body[data-rift-view] #container .rift-coop .rift-coop-sheet[data-stack] .rift-coop-row.post>.rift-author-track{order:2;flex:1 0 100%;width:100%;max-width:none}
body[data-rift-view] #container .rift-coop .rift-coop-sheet[data-stack] .rift-coop-row.post .post_author.rift-coop-side{width:100%;max-width:none;box-sizing:border-box}/* In the topic the pieces stand where the posts do: no padding of the coop page's own. */
.rift-coop-topic .rift-coop-slot{padding:0}
.rift-coop-row .post_author.rift-coop-side{display:flex;flex-direction:column;gap:0;text-align:left}
/* The bubble's margin around its text is --rift-coop-bubble-pad (on .rift-coop-sheet): its spread shadow and rift-coop.js bleed,
   which puts the bubble's edge on the forum column's edge, read it. */
/* The sheet a little lighter than the forum's body (owner 2026-11-19: the document stands apart from the body round it):
   the palette's surface with a fifth of white, in every design. */
.rift-coop-doc{--rift-coop-paper:color-mix(in srgb,var(--rift-chat-surface) 80%,#fff)}
.rift-coop-row .rift-coop-bubble{background:var(--rift-coop-paper);color:var(--rift-chat-text);border-radius:4px;box-shadow:0 0 0 var(--rift-coop-bubble-pad) var(--rift-coop-paper),0 1px 14px var(--rift-coop-bubble-pad) rgba(0,0,0,.18);margin:var(--rift-coop-bubble-pad) 0}
.rift-coop-sheet{--rift-coop-bubble-pad:12px;position:relative;margin:14px calc(-1*var(--rift-coop-bleed-left,0px)) 0 calc(-1*var(--rift-coop-bleed-right,0px));padding:14px var(--rift-coop-pad-right,0px) 14px var(--rift-coop-pad-left,0px);background-color:var(--rift-chat-page-color,transparent);background-image:var(--rift-chat-page-image,none);background-size:var(--rift-chat-page-size,auto);background-position:var(--rift-chat-page-position,0 0);background-repeat:var(--rift-chat-page-repeat,repeat);background-attachment:var(--rift-chat-page-attachment,scroll)}
.rift-coop-history{margin-top:8px}
.rift-coop-history ol{padding-left:20px}
.rift-coop-history li{margin:6px 0}
/* The margin: a card a comment, a suggestion or the comment form, at the piece's height. */
/* A comment's card: the palette's quote colour over the bubbles' surface, as the chat lays its quotes (some designs' quote
   colour is translucent), a shade off the pieces' bubbles (owner 2026-11-18). */
.rift-coop .rift-coop-side .rift-coop-note{margin:12px 0 0;padding:8px 10px;background:linear-gradient(var(--rift-chat-quote),var(--rift-chat-quote)),var(--rift-chat-surface);color:var(--rift-chat-quote-text);border-color:var(--rift-chat-quote-line);border-radius:8px;box-shadow:0 1px 6px rgba(0,0,0,.18)}
.rift-coop-note-head{display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px}
.rift-coop-note-head .rift-coop-person img{width:24px;height:24px}
.rift-coop-note-head small{color:var(--rift-chat-muted)}
.rift-coop-note-head .rift-coop-x{margin-left:auto}
.rift-coop-suggestion{border-style:dashed;border-color:var(--rift-chat-accent)}
.rift-coop-suggestion p{margin:4px 0 0}
.rift-coop-comment-text{margin:4px 0 0;overflow-wrap:anywhere}
.rift-coop-mention{font-weight:bold;color:var(--rift-chat-accent)}
.rift-coop-tags{margin:4px 0 0;display:flex;flex-wrap:wrap;gap:4px 10px}
.rift-coop-tag{color:var(--rift-chat-muted)}
.rift-coop-tag.is-seen{color:var(--rift-chat-accent)}
.rift-coop-tag.is-mine{color:var(--rift-chat-text);font-weight:bold}
.rift-coop-x{background:none;border:0;color:var(--rift-chat-muted);cursor:pointer;font:inherit}
.rift-coop-side form textarea{width:100%;box-sizing:border-box;resize:vertical}
.rift-coop-tag-choice{margin:4px 0;display:flex;flex-wrap:wrap;gap:4px 12px}
.rift-coop-cut{border-color:var(--rift-chat-accent)}
.rift-coop-cut h3{margin:0 0 6px}
.rift-coop-plan{padding-left:0;list-style:none;margin:6px 0}
.rift-coop-plan li{border-top:1px solid var(--rift-chat-line);padding:6px 0}
.rift-coop-plan-head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}
.rift-coop-agreed{color:var(--rift-chat-accent);font-weight:bold}
.rift-coop-waiting{color:var(--rift-chat-muted)}
.rift-coop-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.rift-coop-table{width:100%}
.rift-coop-table td{vertical-align:top}
.rift-coop-dialog{width:min(900px,calc(100vw - 24px));max-height:calc(100vh - 40px);box-sizing:border-box;border:1px solid var(--rift-chat-line);border-radius:6px;background:var(--rift-chat-surface);color:var(--rift-chat-text)}
.rift-coop-dialog::backdrop{background:rgba(0,0,0,.4)}
.rift-coop-dialog input[type=number]{width:8em}
.rift-coop-preview{max-height:55vh;overflow:auto}
/* In the game topic, over the quick reply (rift_coop_topic): a bar of the documents; one opens under it. */
.rift-coop-topic{margin:10px 0 0}
.rift-coop-topic-bar{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center}
.rift-coop-topic-bar .button[aria-pressed=true]{outline:2px solid var(--rift-chat-accent);outline-offset:1px}
@media (max-width:600px){
 .rift-coop{padding:0 4px 16px}
 .rift-coop-table thead{display:none}
 .rift-coop-table,.rift-coop-table tbody,.rift-coop-table tr,.rift-coop-table td{display:block;width:auto}
 .rift-coop-table tr{border-bottom:1px solid var(--rift-chat-line);padding:6px 0}
}
/* A selection on the sheet: its icons in the margin by it, as Google Docs stands them (owner 2026-11-19) — a small
   rounded plate of the forum's editor buttons (parity.css .rift-reply-toolbar button: their size and glyph font). The
   commented fragment is repeated on its card. */
.rift-coop-pick{position:fixed;z-index:10003;padding:4px;border-radius:999px;background:var(--rift-chat-surface,#fff);box-shadow:0 2px 8px rgba(0,0,0,.3)}
/* The buttons sit in a .rift-reply-toolbar of their own, inside the plate: that class lays out the reply form's bar (its
   width, its place), which the plate must not take. */
body[data-rift-view] .rift-coop-pick>.rift-reply-toolbar.rift-reply-toolbar{position:static;display:flex;flex-direction:column;gap:2px;width:auto;margin:0;padding:0;border:0;background:none;box-shadow:none}
.rift-coop-quote{margin:4px 0;padding:2px 8px;border-left:3px solid var(--rift-chat-accent);font-style:italic;overflow-wrap:anywhere}
.rift-coop-quote:empty{display:none}
/* Where the sheet meets the forum body, above and under it, the body's corners are round (owner 2026-11-18): a strip of the
   body's own paint (rift-coop.js bleed: --rift-coop-body-*) with its outer corners cut by the bubble's radius, over the
   sheet's backdrop. */
.rift-coop-sheet::before,.rift-coop-sheet::after{content:"";position:absolute;left:0;right:0;height:var(--rift-coop-bubble-pad);background-color:var(--rift-coop-body-color,transparent);background-image:var(--rift-coop-body-image,none);pointer-events:none}
.rift-coop-sheet::before{top:0;border-radius:0 0 var(--rift-coop-bubble-pad) var(--rift-coop-bubble-pad)}
.rift-coop-sheet::after{bottom:0;border-radius:var(--rift-coop-bubble-pad) var(--rift-coop-bubble-pad) 0 0}
/* No empty band between the sheet and the reply form: the coop's own margins go, and the form's top margin of the design
   when the coop stands over it (its inner padding stays). */
body[data-rift-view] #container .rift-coop-topic~#quick_reply_form{margin-top:0}
/* A comment's thread (owner 2026-11-18, as in Google Docs): the replies under the comment, a hairline between them. */
.rift-coop-reply{margin-top:8px;padding-top:6px;border-top:1px solid var(--rift-chat-quote-line)}
.rift-coop-reply-form{margin-top:6px}
.rift-coop-reply-form textarea{width:100%;box-sizing:border-box;resize:vertical}
.rift-coop-note>[data-coop=reply-open]{margin-top:6px}
/* The live sheet (owner 2026-11-19: one sheet as in Google Docs; rift-coop-editor.js). It is the post's own .post_body,
   so its text has the post's type; the editable area itself has no frame or padding of its own. */
.rift-coop-ed{outline:0;min-height:6em;white-space:pre-wrap;overflow-wrap:break-word;word-wrap:break-word}
/* A paragraph ends with a blank line in the post (BBCode \n\n, drawn as one empty line): the same one line here. */
.rift-coop-ed p{margin:0 0 1lh}
.rift-coop-ed[contenteditable=false]{cursor:default}
/* Each participant's text in their own colour (owner 2026-11-19): a soft tint of the author's hue only, no underline, set
   per author by the editor (an inline <style> from the uid); the faces over the sheet carry the same hue. */
.rift-coop-face{display:inline-flex;align-items:center;gap:6px;padding:2px 8px 2px 2px;border-radius:999px;box-shadow:inset 0 0 0 2px var(--rift-coop-colour)}
.rift-coop-face .rift-coop-mode{margin-left:0}
/* A comment's place, as in Google Docs (owner 2026-11-19): the commented text marked in Google Docs' comment yellow;
   brighter, with its card brought forward, while either is pointed at or chosen (rift-coop.js activate: a rule for that
   comment's id in its own <style>, so the editor's markup is never touched). The yellow is Google Docs' own (#fbbc04),
   not the palette's: it must read as a comment over every author's tint. */
.rift-coop-ed{--rift-coop-comment:rgb(251 188 4 / .35);--rift-coop-comment-active:rgb(251 188 4 / .8)}
.rift-coop-ed .rift-coop-c{background-color:var(--rift-coop-comment);border-radius:2px}
.rift-coop .rift-coop-side .rift-coop-note.is-active{transform:translateX(-10px);box-shadow:0 4px 16px rgba(0,0,0,.35)}
.rift-coop .rift-coop-side .rift-coop-note{transition:transform .15s,box-shadow .15s}
/* A suggested deletion: struck through. */
.rift-coop-ed .rift-coop-del{text-decoration:line-through 2px;opacity:.6}
/* The mark «отсюда в посты»: a line across the sheet with its scissors. */
.rift-coop-ed .rift-coop-ed-cut{margin:10px 0;padding:2px 0;border-top:2px dashed var(--rift-chat-accent);color:var(--rift-chat-accent);font-weight:bold;text-align:right;user-select:none}
.rift-coop-ed .rift-coop-ed-quote cite{display:block;font-style:normal;font-weight:bold;user-select:none}
.rift-coop-ed .rift-coop-ed-spoiler{margin:0 0 1em;padding:4px 10px;border:1px dashed var(--rift-chat-line)}
.rift-coop-ed .rift-coop-ed-spoiler-title{font-weight:bold;user-select:none}
.rift-coop-ed .rift-coop-ed-img{max-width:100%}
.rift-coop-ed .ProseMirror-selectednode{outline:2px solid var(--rift-chat-accent)}
/* The co-authors' cursors with their names (y-prosemirror widgets), the name fading a few seconds after, as in Google
   Docs (each move draws the cursor anew, so the name comes back while they work). */
.rift-coop-caret{position:relative;margin:0 -1px;border-left:2px solid var(--rift-coop-caret);word-break:normal;pointer-events:none}
.rift-coop-caret b{position:absolute;left:-2px;bottom:100%;padding:0 4px;border-radius:3px 3px 3px 0;background:var(--rift-coop-caret);color:#fff;font:bold 11px/16px sans-serif;font-style:normal;white-space:nowrap;user-select:none;animation:rift-coop-flag 3s forwards}
@keyframes rift-coop-flag{0%,70%{opacity:1}100%{opacity:0}}
/* The whole screen (owner 2026-11-19: «только кооп остается», as Google Docs): the document over the page on the forum's
   backdrop (--rift-chat-page-*), its people, the panel kept at the top, the sheet centred at a published post's text
   width with its comments to the right; the choices, the counters and the versions stay on the page. The page under it
   does not scroll. */
html.rift-coop-full,html.rift-coop-full body{overflow:hidden}
/* Over everything of the forum: the design's shell makes a stacking layer of its own (z-index 0) that would keep the
   document under the forum's floating buttons (the sidebar, «наверх», the dock, the chat: z-index up to 10001); while the
   document is on the whole screen the shell makes none, and the document stands over them all. The id twice outweighs
   the designs' body[data-rift-view]:is(.basic,.sylv).basic #rift-design-shell (1,3,1). */
html.rift-coop-full body #rift-design-shell#rift-design-shell{z-index:auto}
body[data-rift-view] #container .rift-coop .rift-coop-doc.is-full{position:fixed;inset:0;z-index:10002;overflow:auto;box-sizing:border-box;padding:12px 16px 40px;
 background-color:var(--rift-chat-page-color,var(--rift-chat-surface));background-image:var(--rift-chat-page-image,none);background-size:var(--rift-chat-page-size,auto);background-position:var(--rift-chat-page-position,0 0);background-repeat:var(--rift-chat-page-repeat,repeat);color:var(--rift-chat-text)}
body[data-rift-view] #container .rift-coop .rift-coop-doc.is-full>:is(.rift-coop-prefs,.rift-coop-tools,.rift-coop-history,.rift-coop-intro){display:none}
/* Its width: the text (--rift-coop-text, measured on a post: rift-coop.js bleed puts it on the document too), the bubble's
   margin on its two sides, and the comments' column (--rift-coop-margin). */
body[data-rift-view] #container .rift-coop .rift-coop-doc.is-full{--rift-coop-margin:360px;--rift-coop-full:calc(var(--rift-coop-text,700px) + 2*var(--rift-coop-bubble-pad,12px) + var(--rift-coop-margin))}
body[data-rift-view] #container .rift-coop .rift-coop-doc.is-full>:is(.rift-coop-people,.rift-coop-cut){max-width:var(--rift-coop-full);margin-left:auto;margin-right:auto;box-sizing:border-box}
/* Its people over the backdrop: on the sheet's paper, so their names read in every design. */
body[data-rift-view] #container .rift-coop .rift-coop-doc.is-full>.rift-coop-people{padding:6px 10px;border-radius:8px;background:var(--rift-coop-paper)}
body[data-rift-view] #container .rift-coop .rift-coop-doc.is-full .rift-coop-sheet{max-width:var(--rift-coop-full);margin:12px auto 0;background:none}
body[data-rift-view] #container .rift-coop .rift-coop-doc.is-full .rift-coop-sheet::before,body[data-rift-view] #container .rift-coop .rift-coop-doc.is-full .rift-coop-sheet::after{content:none}
body[data-rift-view] #container .rift-coop .rift-coop-doc.is-full .rift-coop-panel{position:sticky;top:0;z-index:3;padding-top:6px}
/* The panel over the sheet (owner 2026-11-19): the coop's actions, then the forum's formatting buttons. */
.rift-coop-panel{margin:0 0 10px;padding:0 0 6px;background:var(--rift-coop-paper);border-bottom:1px solid var(--rift-chat-line)}
.rift-coop-panel-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 6px}
.rift-coop-panel-state{color:var(--rift-chat-muted);font-style:italic}
.rift-coop-panel-state.is-error{color:var(--rift-chat-accent);font-style:normal;font-weight:bold}
.rift-coop-color{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
