/* The notebook (rift-dock.js, owner 2026-11-16): a RIFT element of its own, as the chat is. Its colours are each
   design's chat palette (--rift-chat-*, designs.json); its round button, header and tool buttons are the chat's
   (chat.css). The reply form inside is the forum's own and keeps the forum's look. Geometry comes from rift-dock.js as
   properties on the root: --rift-dock-left / --rift-dock-width (the forum's column), --rift-dock-height (pulled by the
   reader), --rift-dock-side (the full mode's width). */
/* Under the chat's windows, over the page. The round buttons' place: the chat's corner (chat.css: --rift-chat-gap, on a
   phone 16px), this one left of the chat's; above an open bottom panel both stand over it. */
:root{--rift-dock-layer:calc(var(--rift-chat-layer) - 1);--rift-dock-corner:var(--rift-chat-gap);--rift-dock-bottom:var(--rift-dock-corner)}
@media (max-width:768px){:root{--rift-dock-corner:16px}}
html[data-rift-dock-mode=open]{--rift-dock-bottom:calc(var(--rift-dock-height) + var(--rift-dock-corner))}
:is(.rift-dock,.rift-dock-list,.rift-dock-frame,.rift-chat-send)[hidden]{display:none}

/* The round button: the chat's, left of it (owner 2026-11-16: not at the bottom edge). A dot while a reply waits. */
.rift-dock-tab{right:calc(var(--rift-dock-corner) + var(--rift-chat-bubble-size) + 12px);bottom:var(--rift-dock-bottom);z-index:var(--rift-dock-layer)}
.rift-dock-tab svg{width:26px;height:26px}
.rift-dock-tab[data-unsent]::after{content:'';position:absolute;top:0;right:0;width:12px;height:12px;border-radius:50%;background:var(--rift-chat-accent);box-shadow:0 0 0 2px var(--rift-chat-action)}
html[data-rift-dock-mode=open] .rift-chat-bubble{bottom:var(--rift-dock-bottom)}
/* The choice over it: «Ответ» and «Блокнот», shown while the button is pointed at (rift-dock.js data-open). */
.rift-dock-choices{position:fixed;right:calc(var(--rift-dock-corner) + var(--rift-chat-bubble-size) + 12px);bottom:calc(var(--rift-dock-bottom) + var(--rift-chat-bubble-size));z-index:var(--rift-dock-layer);display:flex;flex-direction:column;align-items:flex-end;gap:6px;padding-bottom:8px;opacity:0;visibility:hidden;transform:translateY(6px);transition:opacity .12s,transform .12s,visibility 0s .12s}
.rift-dock-choices[data-open]{opacity:1;visibility:visible;transform:none;transition:opacity .12s,transform .12s}
.rift-dock-choice{position:relative;display:flex;align-items:center;gap:8px;padding:8px 14px 8px 11px;border:1px solid var(--rift-chat-line);border-radius:20px;background:var(--rift-chat-action);color:var(--rift-chat-action-text);box-shadow:0 4px 12px #0006;font:bold 12px/1 Verdana,sans-serif;white-space:nowrap;cursor:pointer}
.rift-dock-choice svg{width:16px;height:16px}
.rift-dock-choice:hover,.rift-dock-choice[aria-current]{filter:brightness(1.12)}
.rift-dock-choice[aria-disabled=true]{opacity:.55;cursor:not-allowed;filter:none}
.rift-dock-choice[data-unsent]::after{content:'';position:absolute;top:-2px;right:-2px;width:10px;height:10px;border-radius:50%;background:var(--rift-chat-accent);box-shadow:0 0 0 2px var(--rift-chat-action)}
.rift-dock-choice[data-count]:not([data-count=""])::after{content:attr(data-count);position:absolute;top:-6px;right:-6px;min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:8px;background:var(--rift-chat-accent);color:var(--rift-chat-action-text);font:bold 9px/16px Verdana,sans-serif;text-align:center}
.rift-dock-choice:focus-visible{outline:2px solid var(--rift-chat-accent);outline-offset:2px}

/* The open panel: in the forum's column, from the bottom up to the height pulled to. */
.rift-dock{position:fixed;bottom:0;left:var(--rift-dock-left,0);z-index:var(--rift-dock-layer);display:flex;flex-direction:column;box-sizing:border-box;width:var(--rift-dock-width,100%);height:var(--rift-dock-height,45vh);border:1px solid var(--rift-chat-line);border-bottom:0;border-radius:var(--rift-chat-radius) var(--rift-chat-radius) 0 0;background:var(--rift-chat-surface) var(--rift-chat-surface-image) center top;color:var(--rift-chat-text);box-shadow:0 -8px 30px #0006}
.rift-dock-header{gap:8px;padding-left:12px;border-radius:var(--rift-chat-radius) var(--rift-chat-radius) 0 0;font:13px/1.4 Verdana,sans-serif;cursor:ns-resize}
html[data-rift-dock-mode=full] .rift-dock-header{cursor:default}
.rift-dock-title{flex:1 1 auto;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}
.rift-dock-title a{color:var(--rift-chat-accent)}
.rift-dock-author{font-weight:normal;color:var(--rift-chat-muted)}
.rift-dock-drafts{position:relative}
.rift-dock-count:not(:empty){position:absolute;top:1px;right:0;min-width:14px;height:14px;padding:0 3px;box-sizing:border-box;border-radius:7px;background:var(--rift-chat-accent);color:var(--rift-chat-action-text);font:bold 9px/14px Verdana,sans-serif}
.rift-dock-body{position:relative;flex:1 1 auto;min-height:0;padding:8px 10px;overflow:auto;overscroll-behavior:contain}
.rift-dock[data-kind=frame] .rift-dock-body{padding:0;overflow:hidden}
.rift-dock-frame{display:block;width:100%;height:100%;border:0;background:transparent}
.rift-dock-frame:not([data-ready]){visibility:hidden}
/* No :has() here: the topic pages carry many of them already and each costs on every change of the page. */
.rift-dock-loading{position:absolute;inset:0;display:grid;place-items:center;color:var(--rift-chat-muted);font:13px Verdana,sans-serif}
.rift-dock-frame:is([data-ready],[hidden])+.rift-dock-loading{display:none}
/* The full mode gives the text the window's height (the field's own height: parity.css #quick_reply_form #message). */
html[data-rift-dock-mode=full] .rift-dock[data-kind=form] #quick_reply_form #message{height:calc(100vh - 220px)}
/* The page's end stays reachable above the open panel, and the chat's round button stands above it. */
.rift-dock-spacer{display:none;height:var(--rift-dock-height)}
html[data-rift-dock-mode=open] .rift-dock-spacer{display:block}
/* The notebook: a note's title and text filling the panel in the quick reply field's colours (the chat palette holds
   the same values, parity.css #quick_reply_form #message), its actions under them. */
.rift-dock[data-kind=note] .rift-dock-body{display:flex}
.rift-dock-notepane{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;min-height:0}
:is(.rift-dock-note-title,.rift-dock-note){box-sizing:border-box;width:100%;margin:0;border:1px solid var(--rift-chat-line);border-radius:5px;background:var(--rift-chat-input);color:var(--rift-chat-text);font:12px/1.5 Verdana,sans-serif}
.rift-dock-note-title{flex:none;padding:7px 12px;font-weight:bold}
.rift-dock-note{flex:1 1 auto;min-height:80px;padding:12px;resize:none}
.rift-dock-notebar{display:flex;flex:none;justify-content:space-between;align-items:center;gap:8px}
.rift-dock-drop{padding:0;border:0;background:none;color:var(--rift-chat-muted);font:11px Verdana,sans-serif;text-decoration:underline;cursor:pointer}
.rift-dock-drop:hover{color:var(--rift-chat-text)}

/* «Черновики»: a list under the header. */
.rift-dock-list{flex:none;max-height:50%;padding:4px;overflow:auto;border-bottom:1px solid var(--rift-chat-line);background:var(--rift-chat-surface) var(--rift-chat-surface-image) center top;font:13px/1.4 Verdana,sans-serif}
.rift-dock-item{display:flex;justify-content:space-between;align-items:baseline;gap:12px;width:100%;padding:7px 10px;border:0;border-radius:6px;background:transparent;color:var(--rift-chat-text);font:inherit;text-align:left;cursor:pointer}
.rift-dock-item[aria-current]{background:var(--rift-chat-input);font-weight:bold}
.rift-dock-item:hover{background:var(--rift-chat-action);color:var(--rift-chat-action-text)}
.rift-dock-item-text{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.rift-dock-meta{flex:none;color:var(--rift-chat-muted);font-size:11px;font-weight:normal}
.rift-dock-item:hover .rift-dock-meta{color:inherit}
.rift-dock-more{display:block;padding:7px 10px;color:var(--rift-chat-accent);font-size:11px}
.rift-dock-section{padding:8px 10px 2px;color:var(--rift-chat-muted);font-size:11px;letter-spacing:.04em;text-transform:uppercase}

/* Full mode. With room beside the page's column (rift-dock.js data-rift-dock-split): the right part of the window, its
   left edge pulls, the page keeps its column on the left. Without: the whole window. */
.rift-dock-grip{display:none}
html[data-rift-dock-mode=full][data-rift-dock-split] body{margin-right:var(--rift-dock-side)}
html[data-rift-dock-mode=full][data-rift-dock-split] .rift-dock{top:0;left:auto;right:0;width:var(--rift-dock-side);height:auto;border-bottom:1px solid var(--rift-chat-line);border-right:0;border-radius:var(--rift-chat-radius) 0 0 var(--rift-chat-radius)}
html[data-rift-dock-mode=full][data-rift-dock-split] .rift-dock-header{border-radius:var(--rift-chat-radius) 0 0 0}
html[data-rift-dock-mode=full][data-rift-dock-split] .rift-dock-grip{position:absolute;top:0;bottom:0;left:-4px;z-index:1;display:block;width:8px;cursor:ew-resize;touch-action:none}
html[data-rift-dock-mode=full]:not([data-rift-dock-split]) .rift-dock{inset:0;width:auto;height:auto;border:0;border-radius:0}
html[data-rift-dock-mode=full]:not([data-rift-dock-split]) .rift-dock-header{border-radius:0}

/* The dock's frame shows the editor page's form only (rift-dock.js); the page's floating things stay out of it. */
html[data-rift-dock=frame] :is(.rift-scroll-button,.rift-timeline,.rift-chat-bubble,.rift-chat-window,#rift-notice-stack,#ForumD-ru){display:none}

/* A guest's name for the quick reply (rift_theme.php): one row between the toolbar and the text — «Ваше имя:» and the
   field after it (owner 2026-11-16); the field wears the counter's frame and fill (parity.css .rift-reply-count). */
body[data-rift-view=rift] #quick_reply_form .rift-guest-name{display:flex;align-items:center;gap:8px;margin:5px 0 0;color:#4a4a4a;font:11px Verdana,sans-serif}
body[data-rift-view=rift] #quick_reply_form .rift-guest-name input{box-sizing:border-box;width:220px;padding:4px 8px;background:#0000000d;border:1px solid #73817e6e;border-radius:3px;color:#0e0b07;font:11px Verdana,sans-serif}
/* A guest's picture check in the quick reply's side column (rift_theme.php post_captcha as blocks): the picture the column's
   width, the note, the field as the guest's name field, «Обновить» under it (owner 2026-11-16). */
body[data-rift-view=rift] .rift-reply-side .rift-reply-captcha{display:flex;flex-direction:column;gap:6px;margin:26px 0 0}
/* A short line of what to do over the picture, set off from the buttons by an empty line (margin 26px), owner. */
body[data-rift-view=rift] .rift-reply-side .rift-captcha-title{text-align:center;color:#4a4a4a;font:bold 11px Verdana,sans-serif}
body[data-rift-view=rift] .rift-reply-side .rift-reply-captcha img{box-sizing:border-box;width:100%;height:auto;border:1px solid #73817e6e;border-radius:3px}
body[data-rift-view=rift] .rift-reply-side .rift-captcha-note{text-align:center;color:#8b3a3a;font:10px Verdana,sans-serif}
body[data-rift-view=rift] .rift-reply-side .rift-reply-captcha input{box-sizing:border-box;width:100%;padding:4px 8px;background:#0000000d;border:1px solid #73817e6e;border-radius:3px;color:#0e0b07;font:11px Verdana,sans-serif}
