/* Кооперативный пост (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-composer,.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 pieces (owner 2026-11-18): each 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. The text 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 the bubbles the forum's backdrop, on the page and in the topic, in every
   design: the sheet takes 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\n   stays at its sides, and its padding gives that back, so the posts keep their width. The author's column, placed to the right, holds the piece's comments instead of the mini profile. */
.rift-coop-row.post{margin:0 0 22px;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); this outweighs it by its own classes. It stays sticky, so a long piece's comments
   follow it down the screen. */
body[data-rift-view] #container .rift-coop .rift-coop-row.post :is(.rift-author-track,.post_author.rift-coop-side){background:none;border:0;box-shadow:none;min-height:0;padding:0;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}/* 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. */
.rift-coop-row .rift-coop-bubble{background:var(--rift-chat-surface);color:var(--rift-chat-text);border-radius:4px;box-shadow:0 0 0 var(--rift-coop-bubble-pad) var(--rift-chat-surface),0 1px 14px var(--rift-coop-bubble-pad) rgba(0,0,0,.18);margin:var(--rift-coop-bubble-pad) 0}
.rift-coop-row.is-draft .rift-coop-bubble{outline:1px dashed var(--rift-chat-accent);outline-offset:var(--rift-coop-bubble-pad)}
.rift-coop-row.is-cut .rift-coop-bubble{box-shadow:0 0 0 var(--rift-coop-bubble-pad) var(--rift-chat-surface),0 calc(var(--rift-coop-bubble-pad) + 2px) 0 var(--rift-coop-bubble-pad) var(--rift-chat-accent)}
.rift-coop-bubble>header{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;opacity:.8;margin-bottom:6px}
.rift-coop-bubble>header .rift-coop-person img{width:24px;height:24px}
.rift-coop-bubble>header small{color:var(--rift-chat-muted)}
/* A piece's actions under its text (owner 2026-11-18), quiet until the piece is pointed at or focused. */
.rift-coop-bubble>footer{margin-top:8px;justify-content:flex-end;gap:2px 8px;opacity:.55;transition:opacity .15s}
.rift-coop-row:is(:hover,:focus-within) .rift-coop-bubble>footer{opacity:1}
.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-draft{margin-top:8px;padding:8px;border-left:3px solid var(--rift-chat-accent)}
.rift-coop :is(.rift-coop-draft,.rift-coop-history,.rift-coop-bin) pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;margin:4px 0 0}
.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-comment-form textarea,.rift-coop-field 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-mark{text-align:right;color:var(--rift-chat-accent);font-weight:bold;margin:-8px 0 18px}
.rift-coop-cut{border-color:var(--rift-chat-accent)}
.rift-coop-cut h3,.rift-coop-composer 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-composer .rift-reply-toolbar{margin:0 0 4px}
.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}
}
/* The quick reply's «Ответ в кооп» / «Ответ в тему» (rift-coop.js quick). */
.rift-coop-switch{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin:0 0 8px}
/* The two targets as one rounded pair of tabs (owner 2026-11-18): the radios stay for the keyboard and screen readers,
   the labels are the tabs, the chosen one (.is-on, set by rift-coop.js: no :has()) in the palette's action colours. */
.rift-coop-switch-tabs{display:inline-flex;padding:3px;border:1px solid var(--rift-chat-line);border-radius:999px;background:var(--rift-chat-input)}
.rift-coop-switch-tabs label{position:relative;display:inline-flex;align-items:center;padding:4px 14px;border-radius:999px;color:var(--rift-chat-text);cursor:pointer;white-space:nowrap;transition:background-color .15s,color .15s}
.rift-coop-switch-tabs input{position:absolute;opacity:0;pointer-events:none}
.rift-coop-switch-tabs label.is-on{background:var(--rift-chat-action);color:var(--rift-chat-action-text);font-weight:bold}
.rift-coop-switch-tabs label:focus-within{outline:2px solid var(--rift-chat-accent);outline-offset:1px}
.rift-coop-switch-state{color:var(--rift-chat-muted)}
/* A comment on a selected fragment: the quote bubble's tools by the selection, the fragment on the card, its mark in the
   piece (::highlight, rift-coop.js marks). */
/* The posts' quote bubble (parity.css .rift-quote-bubble) with two buttons side by side; the second one FontAwesome's comment. */
.rift-quote-bubble.rift-coop-tools-bubble{display:flex;gap:4px}
.rift-quote-bubble>button.rift-coop-comment-go{background-image:url("https://api.iconify.design/fa6-solid/comment.svg?color=%23ffffff")}
.rift-coop-quote{margin:4px 0;padding:2px 8px;border-left:3px solid var(--rift-chat-accent);font-style:italic;overflow-wrap:anywhere}
::highlight(rift-coop-quote){background-color:color-mix(in srgb,var(--rift-chat-accent) 25%,transparent)}
::highlight(rift-coop-quote-active){background-color:color-mix(in srgb,var(--rift-chat-accent) 55%,transparent)}
/* The reply form's counter in «в кооп»: one plate, two lines — the field, then the document (rift-coop.js count). Over parity.css's
   one-line plate (its height, body[data-rift-view=rift]… .rift-reply-count). */
body[data-rift-view] #container .rift-reply-count.rift-coop-two{flex-wrap:wrap;height:auto;row-gap:2px;padding-block:3px}
.rift-coop-count-line{flex:1 0 100%;text-align:center}
/* 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}
