.imrey-editor-form { display: grid; gap: 1rem; }
.imrey-editor-form label { display: block; }
.imrey-editor-form label > .fi-input-wrp { margin-block-start: .35rem; }
.imrey-editor-form section, .imrey-editor-form fieldset { display: grid; gap: .85rem; min-width: 0; }
.imrey-editor-form fieldset { border: 1px solid color-mix(in srgb, currentColor 20%, transparent); border-radius: .6rem; padding: 1rem; }
.imrey-editor-form legend { padding-inline: .4rem; font-weight: 600; }
.imrey-editor-form textarea, .imrey-editor-form select[multiple] { display: block; width: 100%; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .5rem; padding: .65rem; background: transparent; color: inherit; }
.imrey-editor-form textarea { min-height: 5rem; resize: vertical; margin-block-start: .35rem; }
.imrey-editor-form select[multiple] { min-height: 6rem; }
.imrey-editor-form .fi-btn { justify-self: start; }
.imrey-editor-form textarea:focus-visible, .imrey-editor-form select[multiple]:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.imrey-list-tools { display: grid; gap: 1rem; }
@media (min-width: 640px) { .imrey-list-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.imrey-contact-editor { display: grid; gap: 1.25rem; min-width: 0; }
.imrey-contact-editor label { display: block; }
/* Plain fields of the page; a Filament field (the draft search, IMR-353) keeps its own wrapper. */
.imrey-contact-editor input:not(.fi-input), .imrey-contact-editor select, .imrey-contact-editor textarea { display: block; width: 100%; max-width: 100%; min-width: 0; margin-block-start: .35rem; padding: .65rem; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .5rem; background: transparent; color: inherit; }
.imrey-contact-editor textarea { resize: vertical; min-height: 5rem; }
.imrey-contact-editor :is(input:not(.fi-input), select, textarea, summary):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.imrey-contact-editor :is(p, summary, h2, h3, h4) { overflow-wrap: anywhere; }
.imrey-contact-editor details { margin-block: .75rem; }
.imrey-contact-editor summary { cursor: pointer; font-weight: 600; }
.imrey-contact-filters { display: grid; gap: 1rem; }
@media (min-width: 768px) { .imrey-contact-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.imrey-contact-editor form, .imrey-contact-editor .space-y-4 { display: grid; gap: 1rem; }
.imrey-accounts { display: grid; gap: 1.5rem; min-width: 0; }
.imrey-accounts-stack { display: grid; gap: 1rem; min-width: 0; }
.imrey-accounts-fields, .imrey-accounts-access { display: grid; gap: 1rem; align-items: start; }
.imrey-accounts-field { display: grid; gap: .5rem; min-width: 0; }
.imrey-accounts-field > label { font-size: .875rem; font-weight: 500; }
.imrey-accounts-row-message { grid-column: 1 / -1; margin: 0; font-size: .875rem; }
.imrey-accounts-actions, .imrey-accounts-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; min-width: 0; }
.imrey-accounts-invitation { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; min-width: 0; }
.imrey-accounts :is(p, label, .fi-section-header-heading) { overflow-wrap: anywhere; }
.imrey-accounts .fi-btn { max-width: 100%; }
.imrey-accounts-textarea { width: 100%; min-width: 0; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .5rem; padding: .65rem; background: transparent; color: inherit; resize: vertical; }
.imrey-accounts-textarea:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.imrey-accounts-alert { padding: 1rem; border: 1px solid currentColor; border-radius: .5rem; }
@media (min-width: 768px) {
    .imrey-accounts-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .imrey-accounts-access { grid-template-columns: minmax(12rem, 20rem) minmax(0, 1fr); align-items: end; }
}

.imrey-contact-send { display: grid; gap: 1rem; min-width: 0; }
.imrey-contact-send .fi-btn { justify-self: start; max-width: 100%; white-space: normal; }
.imrey-contact-editor .imrey-contact-text, .imrey-contact-editor .whitespace-pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

.imrey-surfaces { display: grid; gap: 1.5rem; min-width: 0; }
.imrey-surfaces fieldset { display: grid; gap: .85rem; min-width: 0; padding: 1rem; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .5rem; }
.imrey-surfaces legend { padding-inline: .4rem; font-weight: 600; }
.imrey-surfaces :is(p, li, legend, h2, h3) { overflow-wrap: anywhere; }
.imrey-surfaces ol { padding-inline-start: 1.5rem; list-style: decimal; }
.imrey-surfaces li { margin-block: .5rem; }
.imrey-surfaces button[draggable] { cursor: grab; padding: .5rem; border: 1px solid currentColor; border-radius: .5rem; }
.imrey-surface-preview { display: grid; gap: 1rem; margin-block: 1rem; }
.imrey-workflow > * + * { margin-block-start: .75rem; }
.imrey-editorial-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.imrey-editor-workspace { border: 0; padding: 0; min-width: 0; }
.imrey-editor-locked { margin-block: 1rem; padding: 1rem; border: 1px solid currentColor; border-radius: .5rem; font-weight: 600; }
.imrey-editor-confirm { width: min(32rem, calc(100vw - 2rem)); margin: auto; padding: 1.5rem; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .75rem; background: Canvas; color: CanvasText; box-shadow: 0 1rem 3rem rgb(0 0 0 / .22); }
.imrey-editor-confirm::backdrop { background: rgb(15 23 42 / .55); }
.imrey-editor-confirm h2 { font-size: 1.125rem; font-weight: 650; }
.imrey-editor-confirm p { margin-block: 1rem; overflow-wrap: anywhere; }
.imrey-editor-confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .75rem; }
.imrey-visual-editor { display: grid; gap: .75rem; min-width: 0; }
.imrey-visual-editor .fi-fo-rich-editor { min-height: 20rem; }
/* IMR-305: the formatting toolbar stays in view while a long text scrolls; special blocks are deleted in place. */
.imrey-visual-editor .fi-fo-rich-editor { overflow: visible; }
.imrey-visual-editor .fi-fo-rich-editor-toolbar { position: sticky; top: var(--topbar-height, 56px); z-index: 15; background: var(--imrey-surface, #fff); border-radius: .5rem .5rem 0 0; box-shadow: 0 1px 0 var(--imrey-border, #e5e7eb); }
/* Settings open for the editor blocks; the remaining placeholders (advanced mode only) have no settings to open. */
.imrey-visual-editor [data-id="imrey-canonical-block"] .fi-fo-rich-editor-custom-block-edit-btn-ctn { display: none; }
/* IMR-320: the link panel under a link — where it leads (the kind, the readable address that opens in a new tab), then
   «Изменить» and «Убрать ссылку»; the address is cut to the panel's width, a refused one is named in full. */
.imrey-link-panel-target { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: .375rem; min-width: 0; max-width: min(24rem, calc(100vw - 4rem)); padding: .375rem .5rem; font-size: .875rem; line-height: 1.25rem; }
.imrey-link-panel-target a, .imrey-link-panel-target bdi { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imrey-link-panel-target a { color: var(--primary-600, #2563eb); text-decoration: underline; text-underline-offset: 2px; }
.imrey-link-panel-kind, .imrey-link-panel-note { color: var(--gray-500, #6b7280); }
/* IMR-305 step 3b: the «Ещё блоки» menu opens towards the editor, not past the screen edge. */
.imrey-visual-editor .fi-fo-rich-editor-dropdown-tool { position: relative; }
.imrey-visual-editor .fi-fo-rich-editor-dropdown-tool-menu { inset-inline-start: auto; inset-inline-end: 0; max-width: calc(100vw - 2rem); }
/* IMR-305 step 4: on a phone the toolbar of 25 buttons took five rows (a quarter of the screen) while it floats; it is one
   scrolling row there, and the «Ещё блоки» menu opens at the bottom of the screen, outside the scrolling row. */
@media (max-width: 640px) {
    .imrey-visual-editor .fi-fo-rich-editor-toolbar { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
    .imrey-visual-editor .fi-fo-rich-editor-dropdown-tool { position: static; }
    .imrey-visual-editor .fi-fo-rich-editor-dropdown-tool-menu { position: fixed; inset-inline: 1rem; top: auto; bottom: 1rem; max-width: none; max-height: 60vh; overflow-y: auto; z-index: 30; }
}
/* IMR-318: a thumbnail opens large (media-zoom.js). */
.imrey-media-zoom { display: inline-block; padding: 0; border: 0; border-radius: .375rem; background: none; line-height: 0; cursor: zoom-in; }
.imrey-media-zoom:focus-visible { outline: 2px solid var(--imrey-focus, #2563eb); outline-offset: 2px; }
.imrey-media-zoom-dialog { width: min(96vw, 72rem); max-width: 96vw; max-height: 94vh; margin: auto; padding: 0; border: 0; border-radius: .75rem; background: #111827; color: #f9fafb; }
.imrey-media-zoom-dialog::backdrop { background: rgb(0 0 0 / .72); }
.imrey-media-zoom-dialog figure { display: grid; gap: .5rem; margin: 0; padding: 3.25rem 1rem .75rem; }
.imrey-media-zoom-dialog img, .imrey-media-zoom-dialog video { display: block; max-width: 100%; max-height: calc(94vh - 9rem); margin-inline: auto; object-fit: contain; }
.imrey-media-zoom-dialog video { width: 100%; background: #000; }
.imrey-media-zoom-dialog figure > [hidden] { display: none; }
.imrey-media-zoom-dialog figcaption { text-align: center; overflow-wrap: anywhere; }
.imrey-media-zoom-dialog button { min-height: 2.25rem; padding: .375rem .875rem; border: 1px solid rgb(255 255 255 / .4); border-radius: .5rem; background: rgb(255 255 255 / .08); color: inherit; cursor: pointer; }
.imrey-media-zoom-dialog button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.imrey-media-zoom-close { position: absolute; inset-block-start: .5rem; inset-inline-end: .5rem; }
.imrey-media-zoom-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 1rem 1rem; }
.imrey-media-zoom-nav p { margin: 0; }
.imrey-block-preview { display: grid; gap: .35rem; padding: .25rem 0; min-width: 0; }
.imrey-block-preview img { max-width: 12rem; max-height: 8rem; border-radius: .375rem; object-fit: cover; }
.imrey-block-preview p { margin: 0; overflow-wrap: anywhere; }
.imrey-block-preview-caption { color: var(--imrey-muted, #6b7280); font-style: italic; }
.imrey-block-preview-gallery { display: flex; flex-wrap: wrap; gap: .35rem; }
.imrey-block-preview-gallery img { max-width: 6rem; max-height: 4.5rem; }
.imrey-block-preview blockquote { margin: 0; padding-inline-start: .75rem; border-inline-start: 3px solid var(--imrey-border, #d1d5db); overflow-wrap: anywhere; }
.imrey-block-preview ol { margin: 0; padding-inline-start: 1.25rem; list-style: decimal; overflow-wrap: anywhere; }
.imrey-block-preview .imrey-block-preview-passages { display: grid; gap: .35rem; padding: 0; list-style: none; }
/* IMR-358: the tiles of a grid of numbers in the editor, as the site shows them. */
.imrey-block-preview .imrey-block-preview-grid { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.imrey-block-preview .imrey-block-preview-grid span { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .25rem; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .375rem; font-variant-numeric: tabular-nums; }
.imrey-block-preview-ref { color: var(--imrey-muted, #6b7280); font-variant-numeric: tabular-nums; }
.imrey-media-field { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.imrey-media-field > span { flex-basis: 100%; font-weight: 600; }
.imrey-media-field > p { flex-basis: 100%; overflow-wrap: anywhere; }
.imrey-media-picker { display: grid; gap: 1rem; min-width: 0; }
/* IMR-317: files as a grid of thumbnails or a list, with the chosen file's details beside them. */
.imrey-media-picker-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.imrey-media-picker-body:has(.imrey-media-picker-details) { grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); }
.imrey-media-picker-files { display: grid; gap: .75rem; min-width: 0; }
.imrey-media-picker-list { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.imrey-media-picker-list.is-grid { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.imrey-media-picker-item { display: grid; gap: .5rem; padding: .6rem; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: .65rem; min-width: 0; }
.imrey-media-picker-item.is-focused { border-color: var(--imrey-focus, #2563eb); box-shadow: 0 0 0 1px var(--imrey-focus, #2563eb); }
.is-list .imrey-media-picker-item { grid-template-columns: 6rem minmax(0, 1fr) auto; align-items: start; gap: .75rem; }
.imrey-media-picker-item img, .imrey-media-picker-icon { width: 100%; height: 7rem; object-fit: cover; border-radius: .35rem; }
.is-list .imrey-media-picker-item img, .is-list .imrey-media-picker-icon { width: 6rem; height: 4.5rem; }
.imrey-media-picker-item .imrey-media-zoom { width: 100%; }
.imrey-media-picker-icon { display: grid; place-items: center; background: color-mix(in srgb, currentColor 9%, transparent); font-weight: 600; }
.imrey-media-picker-details { position: sticky; top: 0; display: grid; gap: .75rem; padding: .9rem; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: .65rem; min-width: 0; overflow-wrap: anywhere; }
.imrey-media-picker-details h3 { margin: 0; font-weight: 600; }
.imrey-media-picker-preview { display: grid; gap: .5rem; justify-items: start; }
.imrey-media-picker-preview img, .imrey-media-picker-preview video { width: 100%; max-height: 40vh; object-fit: contain; border-radius: .35rem; background: color-mix(in srgb, currentColor 6%, transparent); }
.imrey-media-picker-preview .imrey-media-zoom > * { display: none; }
.imrey-media-picker-preview .imrey-media-zoom::after { content: "Открыть крупно"; text-decoration: underline; line-height: 1.5; color: var(--imrey-link, #1d4ed8); }
.imrey-media-picker-preview audio { width: 100%; }
/* IMR-551: a video's frame carries a play mark and its length; the details stand under the player. */
.imrey-media-video-thumb, .imrey-media-zoom[data-media-kind="video"] { position: relative; }
.imrey-media-video-thumb { display: inline-grid; }
/* A card of the window stretches its rows; the frame's button keeps the frame's height, so the length sits on the frame. */
.imrey-media-picker-item .imrey-media-zoom[data-media-kind="video"] { align-self: start; }
.imrey-media-video-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.25rem; line-height: 1; text-shadow: 0 1px 3px rgb(0 0 0 / .8); pointer-events: none; }
.imrey-media-video-length { position: absolute; inset-block-end: .25rem; inset-inline-end: .25rem; padding: .05rem .3rem; border-radius: .25rem; background: rgb(0 0 0 / .72); color: #fff; font-size: .75rem; line-height: 1.3; font-variant-numeric: tabular-nums; pointer-events: none; }
.imrey-media-video-facts { margin: 0; font-size: .875rem; overflow-wrap: anywhere; }
.imrey-media-picker-details dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .25rem .75rem; margin: 0; font-size: .875rem; }
.imrey-media-picker-details dt { color: var(--imrey-muted, #6b7280); }
.imrey-media-picker-details dd { margin: 0; }
.imrey-media-picker-why { color: #991b1b; }
.imrey-media-picker-edit { display: grid; gap: .6rem; font-size: .875rem; }
.imrey-media-picker-edit label { display: grid; gap: .25rem; }
.imrey-media-picker-edit .imrey-media-picker-check { display: flex; align-items: flex-start; gap: .5rem; }
.imrey-media-picker-edit .imrey-author-field-error { display: grid; gap: .4rem; justify-items: start; margin: 0; }
.imrey-media-picker-hint { margin: 0; color: var(--imrey-muted, #6b7280); }
.imrey-media-picker-edit-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
/* IMR-668: a file's description and caption on Hebrew pages, one group of every media form. */
.imrey-media-language { display: grid; gap: .6rem; min-width: 0; margin: 0; padding: .5rem .75rem .75rem; border: 1px solid var(--imrey-border); border-radius: var(--imrey-radius); }
.imrey-media-language legend { padding: 0 .25rem; font-weight: 600; }
.imrey-media-language label { display: grid; gap: .25rem; }
.imrey-media-language .imrey-author-field-error { margin: 0; }
.imrey-media-picker-note { margin: 0; font-size: .875rem; color: var(--imrey-muted, #6b7280); }
.imrey-media-picker-upload { padding: .9rem; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: .65rem; }
.imrey-media-picker-upload form { display: grid; gap: .6rem; max-width: 40rem; font-size: .875rem; }
.imrey-media-picker-upload label { display: grid; gap: .25rem; }
.imrey-media-picker-upload input[type="file"] { max-width: 100%; }
.imrey-media-picker-upload .imrey-media-picker-check { display: flex; align-items: flex-start; gap: .5rem; }
.imrey-media-picker-upload progress { width: min(20rem, 100%); vertical-align: middle; }
.imrey-media-picker-upload .imrey-author-field-error { margin: 0; }
.imrey-media-picker-waiting { font-weight: 600; }
.imrey-media-crop { display: grid; gap: .75rem; grid-column: 1 / -1; min-width: 0; }
.imrey-media-crop h3 { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.imrey-media-crop-editor { display: grid; gap: .75rem; justify-items: center; }
.imrey-media-crop-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; }
.imrey-media-crop-tool, .imrey-media-crop-aspect select { min-height: 2.25rem; padding: .3rem .75rem; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .5rem; background: transparent; font-size: .875rem; }
.imrey-media-crop-aspect { display: inline-flex; gap: .4rem; align-items: center; font-size: .875rem; }
.imrey-media-crop-stage { position: relative; overflow: hidden; max-width: 100%; background: color-mix(in srgb, currentColor 8%, transparent); touch-action: none; user-select: none; }
.imrey-media-crop-stage img { position: absolute; top: 50%; left: 50%; max-width: none; pointer-events: none; }
.imrey-media-crop-frame { position: absolute; box-sizing: border-box; border: 2px solid #fff; outline: 1px solid rgba(0, 0, 0, .6); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); cursor: move; touch-action: none; }
.imrey-media-crop-frame:focus-visible { outline: 3px solid var(--imrey-link, #1d4ed8); outline-offset: 2px; }
.imrey-media-crop-handle { position: absolute; width: 1.25rem; height: 1.25rem; background: #fff; border: 1px solid rgba(0, 0, 0, .6); border-radius: 50%; touch-action: none; }
.imrey-media-crop-handle.is-nw { top: 0; left: 0; cursor: nwse-resize; }
.imrey-media-crop-handle.is-ne { top: 0; right: 0; cursor: nesw-resize; }
.imrey-media-crop-handle.is-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.imrey-media-crop-handle.is-se { bottom: 0; right: 0; cursor: nwse-resize; }
.imrey-media-crop-size { margin: 0; font-size: .875rem; color: var(--imrey-muted, #6b7280); }
.imrey-media-picker-pages { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
@media (max-width: 900px) { .imrey-media-picker-body:has(.imrey-media-picker-details) { grid-template-columns: minmax(0, 1fr); } .imrey-media-picker-details { position: static; order: -1; } }
@media (max-width: 640px) { .imrey-media-picker-list.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .is-list .imrey-media-picker-item { grid-template-columns: 4.5rem minmax(0, 1fr); } .is-list .imrey-media-picker-item img, .is-list .imrey-media-picker-icon { width: 4.5rem; height: 4rem; } }
.imrey-revisions { display: grid; gap: 1rem; margin-block: 1.5rem; }
.imrey-preview-link { display: grid; gap: .5rem; padding-block: .5rem; border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
.imrey-preview-link p { margin: 0; }
.imrey-preview-link-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.imrey-revision-difference { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .75rem; padding: .75rem; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .5rem; }
.imrey-revision-difference h4 { grid-column: 1 / -1; overflow-wrap: anywhere; }
.imrey-revision-difference pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
@media (max-width: 600px) { .imrey-revision-difference { grid-template-columns: minmax(0,1fr); } }

.imrey-translations { display: grid; gap: 1.5rem; min-width: 0; }
.imrey-translations :is(p, h2, h3, bdi, summary) { overflow-wrap: anywhere; }
.imrey-translations :is(p, h2, h3) { margin: 0; }
.imrey-translations h2 { font-size: 16px; font-weight: 600; }
.imrey-translations .fi-btn { justify-self: start; max-width: 100%; white-space: normal; }
.imrey-translations-intro, .imrey-translations-panel { display: grid; gap: 1rem; min-width: 0; }
.imrey-translations-panel { padding: 20px; border: 1px solid var(--imrey-border); border-radius: 8px; background: var(--imrey-surface); }
.imrey-translations-section-head, .imrey-translations-actions, .imrey-translations-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; min-width: 0; }
.imrey-translations-section-head { justify-content: space-between; gap: 1rem; }
.imrey-translations-muted { color: var(--imrey-muted); font-size: 13px; }
.imrey-translations-empty { padding: 12px; border-radius: 6px; background: var(--imrey-sunken); color: var(--imrey-muted); }
.imrey-translations-error { padding: 12px; border: 1px solid var(--imrey-danger); border-radius: 6px; background: var(--imrey-danger-soft); color: var(--imrey-danger); }
.imrey-translations-review { border-color: var(--imrey-accent); }
.imrey-translations [tabindex="-1"]:focus-visible { outline: 2px solid var(--imrey-accent); outline-offset: 4px; }
.imrey-translations-loading { color: var(--imrey-muted); }
.imrey-translation-pair { display: grid; gap: 1rem; min-width: 0; }
.imrey-translation-pair article { display: grid; align-content: start; gap: .75rem; min-width: 0; padding: 16px; border: 1px solid var(--imrey-border); border-radius: 6px; }
.imrey-translation-pair article[data-current] { border-inline-start: 3px solid var(--imrey-accent); }
.imrey-translation-pair h3 { font-size: 13px; font-weight: 600; }
.imrey-translation-title { font-size: 15px; font-weight: 600; }
.imrey-translation-marker { padding: 2px 6px; border-radius: 4px; background: var(--imrey-accent-soft); color: var(--imrey-accent-ink); font-size: 12px; }
.imrey-translations-search { display: grid; gap: .5rem; min-width: 0; }
.imrey-translations-search > label { font-size: 13px; font-weight: 500; }
.imrey-translations-search-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .75rem; }
.imrey-translations-candidates { min-width: 0; }
.imrey-translation-candidate { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding-block: 14px; border-block-start: 1px solid var(--imrey-border); }
.imrey-translation-candidate[data-selected] { background: var(--imrey-accent-soft); }
.imrey-translation-candidate-info { display: grid; gap: .5rem; min-width: 0; flex: 1; }
.imrey-translation-candidate h3 { font-size: 14px; font-weight: 500; }
.imrey-translation-candidate > .imrey-translations-actions { flex-shrink: 0; }
.imrey-translations-history details { padding-block: 12px; border-block-start: 1px solid var(--imrey-border); }
.imrey-translations-history summary { cursor: pointer; font-size: 13px; font-weight: 500; }
.imrey-translations-history time { color: var(--imrey-muted); font-weight: 400; }
.imrey-translations-history-change { display: grid; gap: .75rem; padding-block-start: 1rem; }
.imrey-translations-history-change > h3 { font-size: 13px; font-weight: 600; }
.imrey-translation-pair.is-compact article { padding: 12px; gap: .5rem; }
.imrey-translation-pair.is-compact .imrey-translation-title { font-size: 13px; font-weight: 400; }
@media (min-width: 768px) { .imrey-translation-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .imrey-translation-candidate { align-items: start; flex-direction: column; } }
@media (max-width: 600px) { .imrey-translations-panel { padding: 12px; } .imrey-translations-search-controls { grid-template-columns: minmax(0, 1fr); } }

.imrey-seo-editor { display: grid; gap: .75rem; min-width: 0; }
.imrey-seo-editor :is(p, label) { overflow-wrap: anywhere; }

.imrey-donation-lab .fi-btn { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.imrey-donation-lab :is(li, bdi) { overflow-wrap: anywhere; }
.imrey-donation-lab li + li { margin-block-start: .75rem; }

.imrey-resources { display: grid; gap: 1.5rem; min-width: 0; }
.imrey-resources form { display: grid; gap: 1rem; margin-block-start: 1rem; min-width: 0; }
.imrey-resources label { display: grid; gap: .35rem; min-width: 0; font-size: .875rem; font-weight: 500; overflow-wrap: anywhere; }
.imrey-resources label:has(> input[type="checkbox"]) { display: flex; flex-wrap: wrap; align-items: center; }
.imrey-resources :is(input:not([type="checkbox"]), select, textarea) { display: block; width: 100%; min-width: 0; max-width: 100%; padding: .65rem; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .5rem; background: transparent; color: inherit; font: inherit; }
.imrey-resources textarea { resize: vertical; }
.imrey-resources :is(input, select, textarea):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.imrey-resources :is(p, h3, li, bdi) { overflow-wrap: anywhere; }
.imrey-resources ol { padding-inline-start: 1.5rem; list-style: decimal; }
.imrey-resources li + li { margin-block-start: .5rem; }
.imrey-resources .fi-btn { max-width: 100%; width: fit-content; white-space: normal; }
.imrey-resource-hint { display: block; color: #64748b; font-size: .8rem; font-weight: 400; line-height: 1.4; }
.imrey-resource-errors { padding: .85rem 1rem; border: 1px solid #ef4444; border-radius: .5rem; color: #991b1b; background: #fef2f2; }
.imrey-resource-errors ul { margin-block-start: .4rem; padding-inline-start: 1.25rem; list-style: disc; }
.imrey-resource-errors li + li { margin-block-start: .25rem; }
.dark .imrey-resource-hint { color: #94a3b8; }
.dark .imrey-resource-errors { border-color: #f87171; color: #fecaca; background: #450a0a; }
.imrey-resource-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.imrey-resource-action { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .5rem .85rem; border-radius: .5rem; background: #92400e; color: #fff; font-weight: 600; text-decoration: none; }
.imrey-resource-action:hover { background: #78350f; color: #fff; }
.imrey-resource-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin-block: 1rem; }
.imrey-resource-subform { display: grid; gap: .75rem; padding: 1rem; border: 1px solid color-mix(in srgb, currentColor 15%, transparent); border-radius: .5rem; }
.imrey-resource-table-wrap { overflow-x: auto; max-width: 100%; margin-block: 1rem; }
.imrey-resource-table { width: 100%; min-width: 48rem; border-collapse: collapse; font-size: .875rem; }
.imrey-resource-table th, .imrey-resource-table td { padding: .7rem .6rem; border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); text-align: start; vertical-align: top; }
.imrey-resource-table th { font-weight: 700; }
.imrey-resource-table td:first-child { width: 4rem; }
.imrey-resource-table input[type="checkbox"] { width: 1.1rem; height: 1.1rem; }
.imrey-resource-row-actions { display: flex; flex-wrap: wrap; gap: .45rem .75rem; }
.imrey-resource-table a, .imrey-resources p a, .imrey-resources ol a { text-decoration: underline; text-underline-offset: .15rem; }

/* IMR-322: versions compared like code changes — older on the left, newer on the right. */
.imrey-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.imrey-diff { display: grid; gap: 1rem; min-width: 0; margin-block: 1rem; }
.imrey-diff-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.imrey-diff-head h3 { margin: 0; }
.imrey-diff-stats { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; font-variant-numeric: tabular-nums; }
.imrey-diff-count-add { color: #166534; }
.imrey-diff-count-remove { color: #991b1b; }
.imrey-diff-modes { display: inline-flex; border: 1px solid var(--imrey-border, #d1d5db); border-radius: .5rem; overflow: hidden; }
.imrey-diff-modes button { padding: .25rem .75rem; background: transparent; cursor: pointer; }
/* IMR-392: the text of a pressed toggle is the surface colour, so it reads on the ink in the light and the dark theme. */
.imrey-diff-modes button[aria-pressed="true"] { background: var(--imrey-ink, #111827); color: var(--imrey-surface, #fff); }
.imrey-diff-modes button:focus-visible, .imrey-diff-fold button:focus-visible { outline: 2px solid var(--imrey-focus, #2563eb); outline-offset: 2px; }
.imrey-diff-section { min-width: 0; }
.imrey-diff-section h4 { margin: 0 0 .25rem; font-weight: 600; }
.imrey-diff-split { width: 100%; table-layout: fixed; border-collapse: collapse; border: 1px solid var(--imrey-border, #e5e7eb); font-size: .9375rem; }
.imrey-diff-split td { padding: .25rem .5rem; vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; border-top: 1px solid #f1f5f9; }
.imrey-diff-split .imrey-diff-no-col { width: 3rem; }
.imrey-diff-no { text-align: end; color: var(--imrey-muted, #6b7280); font-variant-numeric: tabular-nums; user-select: none; }
.imrey-diff-split .imrey-diff-remove td:nth-child(2), .imrey-diff-split .imrey-diff-change td:nth-child(2) { background: #fef2f2; }
.imrey-diff-split .imrey-diff-add td:nth-child(4), .imrey-diff-split .imrey-diff-change td:nth-child(4) { background: #f0fdf4; }
.imrey-diff-split .imrey-diff-blank { background: #f8fafc; }
.imrey-diff del.imrey-diff-word { background: #fecaca; text-decoration: line-through; text-decoration-color: rgb(153 27 27 / .55); border-radius: .2rem; }
.imrey-diff ins.imrey-diff-word { background: #bbf7d0; text-decoration: none; border-radius: .2rem; }
.imrey-diff-fold td, li.imrey-diff-fold { background: #f8fafc; text-align: center; }
.imrey-diff-fold button { padding: .25rem .5rem; color: var(--imrey-link, #1d4ed8); text-decoration: underline; cursor: pointer; }
.imrey-diff-unified, .imrey-diff-unified ol { margin: 0; padding: 0; list-style: none; }
.imrey-diff-unified { border: 1px solid var(--imrey-border, #e5e7eb); font-size: .9375rem; }
.imrey-diff-unified li:not(.imrey-diff-fold) { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); padding: .25rem .5rem; white-space: pre-wrap; overflow-wrap: anywhere; border-top: 1px solid #f1f5f9; }
.imrey-diff-unified .imrey-diff-remove { background: #fef2f2; }
.imrey-diff-unified .imrey-diff-add { background: #f0fdf4; }
.imrey-diff-unified li.imrey-diff-fold ol { text-align: start; }
.imrey-diff-mark { color: var(--imrey-muted, #6b7280); font-weight: 600; }

/* IMR-317: the file field of an editor block's settings window. */
.imrey-media-field-block { display: grid; gap: .5rem; min-width: 0; }
.imrey-media-field-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.imrey-media-field-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.imrey-media-field-list bdi { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.imrey-media-field-tools { display: inline-flex; gap: .25rem; }

/* IMR-328 (owner, 2026-10-07, variant B; deploy/cms/design/proposals/entry-editor-2026-10-07): a top row with the crumbs,
   the status and the save time; one column up to 1200 px (owner, wider than the mockup's 860 px) with the title, tabs and panels; a bar at the bottom of every tab.
   Structure and sizes follow the mockup; colours come from the --imrey-* tokens (the sample's ax-* classes are not used). */
.imrey-editor { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: calc(100dvh - var(--topbar-height, 64px) - 64px); }
.imrey-editor-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; padding-block-end: 12px; border-block-end: 1px solid var(--imrey-border); }
.imrey-editor-crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--imrey-muted); font-size: 13px; }
.imrey-editor-crumbs a { color: var(--imrey-muted); text-decoration: none; }
.imrey-editor-crumbs a:hover { color: var(--imrey-ink); }
.imrey-editor-crumbs b { overflow: hidden; color: var(--imrey-ink); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.imrey-editor-crumbs-sep { width: 14px; height: 14px; flex: none; }
.imrey-editor-grow { flex: 1; }
.imrey-editor-saved { display: inline-flex; align-items: center; gap: 6px; color: var(--imrey-muted); font-size: 13px; }
.imrey-editor-saved > span { display: inline-flex; align-items: center; gap: 6px; }
.imrey-editor-saved-icon { width: 14px; height: 14px; }
.imrey-editor-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--imrey-sunken); color: var(--imrey-muted); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; }
.imrey-editor-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.imrey-editor-badge[data-plain] { height: 18px; font-size: 11px; }
.imrey-editor-badge[data-plain]::before { display: none; }
.imrey-editor-badge[data-tone="success"] { background: var(--imrey-success-soft); color: var(--imrey-success); }
.imrey-editor-badge[data-tone="warning"] { background: var(--imrey-warning-soft); color: var(--imrey-warning); }
.imrey-editor-badge[data-tone="info"] { background: var(--imrey-info-soft); color: var(--imrey-info); }
.imrey-editor-column { display: grid; gap: 16px; width: 100%; max-width: 1200px; min-width: 0; margin-inline: auto; padding-block: 8px 24px; }
.imrey-editor.has-translation-review .imrey-editor-column { max-width: 1760px; }
.imrey-translation-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; min-width: 0; font-size: 13px; }
.imrey-translation-bar a, .imrey-translation-block-heading button { color: var(--imrey-accent); text-decoration: underline; text-underline-offset: 3px; }
.imrey-translation-layout, .imrey-translation-target { display: grid; gap: 16px; min-width: 0; }
.imrey-translation-reference { min-width: 0; align-self: start; overflow-wrap: anywhere; border: 1px solid var(--imrey-border); border-radius: 10px; background: var(--imrey-surface); }
.imrey-translation-reference-heading { display: grid; gap: 8px; padding: 16px 20px; border-block-end: 1px solid var(--imrey-border); font-size: 13px; }
.imrey-translation-reference-heading h2 { font-size: 15px; font-weight: 700; }
.imrey-translation-reference-body { padding: 20px; }
.imrey-translation-reference-body > h3 { font-size: 28px; line-height: 36px; font-weight: 700; }
.imrey-translation-summary { font-size: 18px; line-height: 28px; margin-block: 12px 20px; color: var(--imrey-muted); }
.imrey-translation-reference-block { padding-block: 16px; border-block-start: 1px solid var(--imrey-border); }
.imrey-translation-block-heading { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-block-end: 12px; color: var(--imrey-muted); font-size: 12px; }
.imrey-translation-block-heading button { min-height: 32px; }
.imrey-translation-plain { white-space: pre-wrap; }
.imrey-translation-reference .fi-prose { max-width: none; }
.imrey-translation-reference :is(table, pre) { max-width: 100%; overflow-x: auto; }
/* The review keeps the text alongside its source; the cover remains editable in the ordinary mode. */
.imrey-translation-layout.is-open .imrey-editor-cover { display: none; }
@media (min-width: 1100px) {
    .imrey-translation-layout.is-open { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
    .imrey-translation-reference { position: sticky; top: calc(var(--topbar-height, 56px) + 12px); max-height: calc(100dvh - var(--topbar-height, 56px) - 100px); overflow-y: auto; }
    .imrey-translation-reference { overflow-anchor: none; scroll-behavior: auto; }
    .imrey-translation-reference-body { padding-block-start: calc(20px + var(--imrey-translation-offset, 0px)); padding-block-end: 100dvh; }
    .imrey-translation-layout.is-open .imrey-editor-doc-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1099px) {
    .imrey-translation-reference-body { max-height: 45dvh; overflow-y: auto; }
}
.imrey-editor-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.imrey-editor-title { margin: 0; color: var(--imrey-ink); font-size: 24px; font-weight: 600; line-height: 32px; letter-spacing: -0.015em; }
.imrey-editor-summary { margin: 2px 0 0; color: var(--imrey-muted); overflow-wrap: anywhere; }
.imrey-editor-context { margin: 0; color: var(--imrey-muted); font-size: 13px; }
.imrey-editor-context a, .imrey-editor-card a, .imrey-editor-hint a { color: var(--imrey-accent-ink); }
.imrey-editor-context a:hover, .imrey-editor-card a:hover, .imrey-editor-hint a:hover { color: var(--imrey-accent); }
.imrey-editor-segment { display: inline-flex; padding: 2px; border: 1px solid var(--imrey-border); border-radius: var(--imrey-radius); background: var(--imrey-sunken); }
.imrey-editor-segment button { height: 26px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--imrey-muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.imrey-editor-segment button[aria-pressed="true"] { background: var(--imrey-surface); color: var(--imrey-ink); box-shadow: var(--imrey-shadow-xs); cursor: default; }
.imrey-editor-segment button:focus-visible, .imrey-editor-tab:focus-visible, .imrey-editor-ghost:focus-visible { outline: 2px solid var(--imrey-accent); outline-offset: 2px; }
.imrey-editor-errors { padding: 12px 16px; border: 1px solid var(--imrey-danger); border-radius: var(--imrey-radius); background: var(--imrey-danger-soft); color: var(--imrey-ink); }
.imrey-editor-errors ul { margin: 6px 0 0; padding-inline-start: 1.2rem; list-style: disc; }
.imrey-editor-errors a { color: var(--imrey-danger); text-decoration: underline; text-underline-offset: 3px; }
/* Relative, so the screen-reader text of a tab stays inside the scrolling list and never widens the page at 360 px. */
.imrey-editor-tabs { position: relative; display: flex; gap: 20px; min-width: 0; overflow-x: auto; border-block-end: 1px solid var(--imrey-border); scrollbar-width: thin; }
.imrey-editor-tab { display: inline-flex; flex: none; align-items: center; gap: 6px; margin-block-end: -1px; padding: 10px 0; border: 0; border-block-end: 2px solid transparent; background: none; color: var(--imrey-muted); font-size: 14px; font-weight: 500; line-height: 20px; cursor: pointer; }
.imrey-editor-tab:hover { color: var(--imrey-ink); }
.imrey-editor-tab[aria-selected="true"] { border-block-end-color: var(--imrey-accent); color: var(--imrey-ink); }
.imrey-editor-count { padding: 0 6px; border-radius: 999px; background: var(--imrey-sunken); color: var(--imrey-muted); font-size: 12px; }
.imrey-editor-tab-error { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--imrey-danger); color: var(--imrey-surface); font-size: 12px; font-weight: 700; }
.imrey-editor-panel:not([hidden]) { display: grid; gap: 16px; min-width: 0; }
.imrey-editor-hint { margin: 0; color: var(--imrey-muted); font-size: 12px; line-height: 16px; }
.imrey-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.imrey-editor-ghost { height: 28px; padding: 0 8px; border: 0; border-radius: var(--imrey-radius); background: none; color: var(--imrey-ink); font-size: 13px; font-weight: 500; cursor: pointer; }
.imrey-editor-ghost:hover { background: var(--imrey-hover); }

/* «Текст» (owner, 2026-10-08): a card with the title and the summary, the cover as a picture at its side, the other fields of
   the type below; then the text editor with its own formatting bar on top and «?» at its end. The text keeps a readable line
   of about 760 px in the middle of a wide page. */
.imrey-editor-doc-card { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px 24px; min-width: 0; padding: 24px 28px; border: 1px solid var(--imrey-border); border-radius: 10px; background: var(--imrey-surface); }
.imrey-editor-doc-card:not(:has(.imrey-editor-cover)) { grid-template-columns: minmax(0, 1fr); }
.imrey-editor-doc-main { display: grid; align-content: start; gap: 16px; min-width: 0; }
.imrey-editor-doc-more { grid-column: 1 / -1; min-width: 0; }
.imrey-editor-doc-field { display: grid !important; gap: 4px; min-width: 0; }
.imrey-editor-doc-title { width: 100%; min-height: 36px !important; margin: 0 !important; padding: 0 !important; overflow: hidden; border: 0 !important; background: transparent !important; color: var(--imrey-ink) !important; font-size: 28px; font-weight: 700; line-height: 36px; letter-spacing: -0.02em; resize: none !important; field-sizing: content; }
.imrey-editor-doc-summary { width: 100%; min-height: 56px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; color: var(--imrey-muted) !important; font-size: 18px; line-height: 28px; resize: none !important; }
.imrey-editor-doc-title:focus-visible, .imrey-editor-doc-summary:focus-visible { outline: 2px solid var(--imrey-accent) !important; outline-offset: 4px; border-radius: 2px; }
.imrey-editor-doc-title[aria-invalid="true"] { text-decoration: underline wavy var(--imrey-danger); text-underline-offset: 6px; }
.imrey-editor-cover { display: grid; align-content: start; gap: 8px; min-width: 0; }
.imrey-editor-cover-box { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--imrey-border); border-radius: 10px; background: var(--imrey-sunken); color: var(--imrey-muted); font-size: 13px; text-align: center; }
.imrey-editor-cover-box .imrey-media-zoom { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.imrey-editor-cover-box .imrey-media-zoom img { width: 100%; height: 100%; object-fit: cover; }
.imrey-editor-sheet { position: relative; min-width: 0; border: 1px solid var(--imrey-border); border-radius: 10px; background: var(--imrey-surface); }
.imrey-editor-sheet .imrey-visual-editor .fi-fo-field-label-col, .imrey-editor-sheet .imrey-visual-editor .fi-fo-field-label-ctn { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.imrey-editor-sheet .imrey-visual-editor .fi-fo-rich-editor { border: 0; border-radius: 10px; background: transparent; box-shadow: none; }
.imrey-editor-sheet .fi-fo-rich-editor-toolbar { border-radius: 10px 10px 0 0; border-block-end: 1px solid var(--imrey-border); padding-inline-end: 48px; }
.imrey-editor-sheet .fi-fo-rich-editor-main { width: 100%; max-width: calc(760px + 64px); min-width: 0; margin-inline: auto; padding: 8px 32px 36px; }
.imrey-editor-sheet .fi-fo-rich-editor-content { min-height: 12rem; padding: 0; }
.imrey-editor-help { position: absolute; z-index: 16; inset-block-start: 6px; inset-inline-end: 8px; }
.imrey-editor-help > summary { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--imrey-radius); color: var(--imrey-muted); cursor: pointer; list-style: none; }
.imrey-editor-help > summary > svg { width: 18px; height: 18px; }
.imrey-editor-help > summary:hover { background: var(--imrey-hover); color: var(--imrey-ink); }
.imrey-editor-help > summary::-webkit-details-marker { display: none; }
.imrey-editor-help > summary:focus-visible { outline: 2px solid var(--imrey-accent); outline-offset: 2px; }
.imrey-editor-help > p { position: absolute; inset-inline-end: 0; width: min(32rem, calc(100vw - 2rem)); margin-block-start: 6px; padding: 12px 14px; border: 1px solid var(--imrey-border); border-radius: var(--imrey-radius); background: var(--imrey-surface); color: var(--imrey-ink); font-size: 13px; line-height: 1.5; box-shadow: 0 8px 24px rgba(28, 27, 24, 0.12), 0 1px 3px rgba(28, 27, 24, 0.08); }
.imrey-editor-blocks { display: grid; gap: 16px; padding: 20px 32px 32px; min-width: 0; }

/* «Свойства», «Адрес и SEO», «История и копии»: one card, a row per group. */
.imrey-editor-card { min-width: 0; padding-inline: 20px; border: 1px solid var(--imrey-border); border-radius: 10px; background: var(--imrey-surface); }
.imrey-editor-row { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 12px 24px; padding-block: 20px; border-block-end: 1px solid var(--imrey-border); }
.imrey-editor-row:last-child { border-block-end: 0; }
.imrey-editor-row-head h2 { margin: 0; color: var(--imrey-ink); font-size: 14px; font-weight: 500; line-height: 20px; }
.imrey-editor-row-head p { margin: 2px 0 0; color: var(--imrey-muted); font-size: 13px; line-height: 18px; }
.imrey-editor-row-body { display: grid; align-content: start; gap: 10px; min-width: 0; }
.imrey-editor-row-body h3 { margin: 4px 0 0; font-size: 13px; font-weight: 600; }
.imrey-editor-kv { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13px; }
.imrey-editor-kv-wide { grid-template-columns: 110px minmax(0, 1fr); }
.imrey-editor-kv dt { color: var(--imrey-muted); }
.imrey-editor-kv dd { margin: 0; overflow-wrap: anywhere; color: var(--imrey-ink); }
.imrey-editor-kv dd a { margin-inline-start: 4px; font-size: 13px; }
.imrey-editor-author-select { display: flex; align-items: center; gap: 8px; max-width: 420px; }
.imrey-editor-author-select .fi-input-wrp { flex: 1; min-width: 0; }

/* IMR-328 step 3: «Адрес и SEO» — the address on the site, counters of the search texts, the folded social and indexing block. */
.imrey-editor-hint[data-tone=warning], .imrey-seo-more summary [data-tone=warning] { color: var(--imrey-warning); }
/* IMR-668: the images of a Hebrew material whose files have no Hebrew text. */
.imrey-editor-media-gaps { padding: 8px 12px; border-radius: var(--imrey-radius); background: var(--imrey-warning-soft); font-size: 13px; line-height: 18px; }
.imrey-editor-media-gaps p { margin: 0; }
.imrey-editor-media-gaps ul { margin: 4px 0 0; padding-inline-start: 18px; list-style: disc; overflow-wrap: anywhere; }
.imrey-editor-media-gaps a { color: inherit; text-decoration: underline; }
.imrey-seo-slug { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.imrey-seo-address { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.imrey-seo-address bdi { overflow-wrap: anywhere; }
.imrey-seo-textarea { display: block; width: 100%; min-height: 72px; padding: 8px 12px; border: 0; background: transparent; color: inherit; font: inherit; line-height: 20px; resize: vertical; }
.imrey-seo-textarea:focus { outline: none; }
.imrey-seo-count { margin-block-start: -6px; font-variant-numeric: tabular-nums; }
.imrey-seo-more { border-block-start: 1px solid var(--imrey-border); padding-block-start: 12px; }
.imrey-seo-more > summary { color: var(--imrey-accent-ink); font-size: 13px; font-weight: 500; line-height: 18px; cursor: pointer; }
.imrey-seo-more > summary:focus-visible { outline: 2px solid var(--imrey-accent); outline-offset: 2px; border-radius: 4px; }
.imrey-seo-more-body { display: grid; gap: .75rem; padding-block-start: 12px; }

/* IMR-328 step 2: rubrics and tags as chips; a rubric chip shows its path and the mark of the primary rubric. */
.imrey-terms { display: grid; gap: 20px; }
.imrey-terms-group { display: grid; gap: 8px; min-width: 0; }
.imrey-terms-group h3 { margin: 0; color: var(--imrey-ink); font-size: 13px; font-weight: 600; }
.imrey-terms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.imrey-terms-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px; padding-block: 2px; padding-inline: 10px 4px; border: 1px solid var(--imrey-border-strong); border-radius: 999px; background: var(--imrey-surface); color: var(--imrey-ink); font-size: 13px; line-height: 18px; }
.imrey-terms-chip[data-primary] { border-color: var(--imrey-accent); background: var(--imrey-accent-soft); color: var(--imrey-accent-ink); font-weight: 500; }
.imrey-terms-chip label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; cursor: pointer; }
.imrey-terms-chip input[type=radio] { flex: none; width: 14px; height: 14px; margin: 0; accent-color: var(--imrey-accent); }
.imrey-terms-chip bdi { overflow-wrap: anywhere; }
.imrey-terms-chip button { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--imrey-muted); cursor: pointer; }
.imrey-terms-chip button:hover { background: var(--imrey-hover); color: var(--imrey-ink); }
.imrey-terms-chip button:focus-visible, .imrey-terms-options button:focus-visible { outline: 2px solid var(--imrey-accent); outline-offset: 1px; }
.imrey-terms-chip button svg { width: 14px; height: 14px; }
.imrey-terms-none { color: var(--imrey-muted); font-size: 13px; }
.imrey-terms-search { position: relative; max-width: 32rem; }
.imrey-terms-options { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 30; max-height: 320px; margin: 0; padding: 4px; overflow-y: auto; border: 1px solid var(--imrey-border); border-radius: 8px; background: var(--imrey-surface); box-shadow: 0 8px 24px rgb(0 0 0 / .12); list-style: none; }
.imrey-terms-options .imrey-terms-none { padding: 8px 10px; }
.imrey-terms-options button { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--imrey-ink); font-size: 14px; line-height: 20px; text-align: start; cursor: pointer; }
.imrey-terms-options button:hover, .imrey-terms-options button:focus-visible { background: var(--imrey-hover); }
.imrey-terms-options mark { border-radius: 2px; background: var(--imrey-warning-soft); color: inherit; }
.imrey-terms-path { color: var(--imrey-muted); }
.imrey-terms-hint { color: var(--imrey-muted); font-size: 12px; font-weight: 400; }
.imrey-terms-count { flex: none; color: var(--imrey-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* IMR-308 step 4 (mockup 4-editor-pickers, R3): the rubric tree with checkboxes, always in view; tags are created from the list. */
.imrey-terms-tree { max-width: 32rem; max-height: 320px; margin: 0; padding: 4px 0; overflow-y: auto; border: 1px solid var(--imrey-border); border-radius: 8px; background: var(--imrey-surface); list-style: none; }
.imrey-terms-tree li { display: flex; align-items: center; gap: 12px; padding-block: 5px; padding-inline: calc(10px + var(--depth, 0) * 20px) 12px; }
.imrey-terms-tree li[data-checked] { background: var(--imrey-accent-soft); }
.imrey-terms-tree li[data-context] { color: var(--imrey-muted); }
.imrey-terms-tree label { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; color: inherit; font-size: 14px; line-height: 20px; cursor: pointer; }
.imrey-terms-tree input[type=checkbox] { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--imrey-accent); }
.imrey-terms-tree input[type=checkbox]:focus-visible { outline: 2px solid var(--imrey-accent); outline-offset: 2px; }
.imrey-terms-tree span[dir] { overflow-wrap: anywhere; }
.imrey-terms-tree mark { border-radius: 2px; background: var(--imrey-warning-soft); color: inherit; }
.imrey-terms-tree .imrey-terms-none { padding: 8px 12px; }
.imrey-terms-help { max-width: 32rem; margin: 0; color: var(--imrey-muted); font-size: 12px; line-height: 1.5; }
.imrey-terms-options .imrey-terms-create { justify-content: flex-start; color: var(--imrey-accent-ink); }
.imrey-terms-create svg { display: inline; width: 14px; height: 14px; vertical-align: -2px; }

/* The bar: the state and the warnings on the left, the actions on the right; it stays at the bottom of the window. */
.imrey-editor-bar { position: sticky; bottom: 0; z-index: 20; margin-block-start: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 24px; border-block-start: 1px solid var(--imrey-border); background: var(--imrey-sunken); }
.imrey-editor-bar-state { display: flex; flex: 1 1 16rem; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.imrey-editor-bar-status { margin: 0; color: var(--imrey-muted); font-size: 13px; }
.imrey-editor-link { padding: 0; border: 0; background: none; color: var(--imrey-accent-ink); font-size: 13px; cursor: pointer; }
.imrey-editor-link:hover { color: var(--imrey-accent); text-decoration: underline; text-underline-offset: 3px; }
.imrey-editor-link:focus-visible { outline: 2px solid var(--imrey-accent); outline-offset: 2px; }
.imrey-editor-bar-status:empty { display: none; }
.imrey-editor-bar-status:focus { outline: none; }
.imrey-editor-bar-status:focus-visible { outline: 2px solid var(--imrey-accent); outline-offset: 2px; }
.imrey-editor-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.imrey-editor-kbd { margin-inline-start: 6px; padding: 0 4px; border: 1px solid var(--imrey-border); border-radius: 4px; color: var(--imrey-muted); font-size: 11px; font-weight: 500; line-height: 16px; }
/* IMR-306 E5: the optional reason, only for a material that is on the site; above the tabs, so every tab shows it. */
.imrey-editor-why { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-block-end: 12px; color: var(--imrey-muted); font-size: 13px; }
.imrey-editor-why-label { color: var(--imrey-ink); font-weight: 500; }
.imrey-editor-why-hint { margin-inline-start: 4px; color: var(--imrey-muted); font-weight: 400; }
.imrey-editor-why .fi-input-wrp { flex: 1 1 18rem; min-width: 0; max-width: 32rem; margin: 0 !important; }
@media (max-width: 640px) {
    .imrey-editor-help { position: static; display: flex; justify-content: flex-end; margin: 4px 8px 0; }
    .imrey-editor-sheet .fi-fo-rich-editor-toolbar { padding-inline-end: 12px; }
    .imrey-editor-doc-card { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
    .imrey-editor-row { grid-template-columns: minmax(0, 1fr); }
    .imrey-editor-card { padding-inline: 12px; }
    .imrey-editor-sheet .fi-fo-rich-editor-main, .imrey-editor-blocks { padding: 0 16px 24px; }
    .imrey-editor-doc-title { font-size: 24px; line-height: 30px; }
    .imrey-editor-bar { padding: 8px 12px; }
    .imrey-editor-bar-actions { flex: 1 1 100%; }
    .imrey-editor-kbd { display: none; }
}
/* IMR-307: what a new material needs before a field can offer anything (authors, rubrics and tags come with the type). */
.imrey-editor-notice { margin: 0; padding: 10px 12px; border: 1px solid var(--imrey-info-soft, #e4edf6); border-radius: 8px; background: var(--imrey-info-soft, #e4edf6); color: var(--imrey-info, #245a8c); font-size: 13px; line-height: 1.5; }

/* IMR-407: selected typography proposals, in the editor's native modal. */
.imrey-typography-dialog { width: min(50rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; }
.imrey-typography-list { display: grid; gap: .75rem; max-height: 50vh; overflow-y: auto; margin-block: 1rem; }
.imrey-typography-proposal { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem; border: 1px solid color-mix(in srgb, currentColor 20%, transparent); border-radius: .5rem; }
.imrey-typography-proposal > span { min-width: 0; overflow-wrap: anywhere; }
.imrey-typography-before, .imrey-typography-after { display: block; margin-block-start: .5rem; white-space: pre-wrap; }
.imrey-typography-before > span, .imrey-typography-after > span { font-weight: 600; }
.imrey-typography-dialog > .imrey-editor-confirm-actions { margin-block-start: 1rem; }

/* IMR-509: the candidate dialog is outside the synchronized source pane. */
.imrey-block-translation-dialog { width: min(64rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; }
.imrey-block-translation-controls, .imrey-block-translation-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-block: 1rem; }
.imrey-block-translation-dialog label { display: grid; gap: .375rem; min-width: 0; }
.imrey-block-translation-dialog .fi-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 640px) { .imrey-block-translation-controls, .imrey-block-translation-previews { grid-template-columns: minmax(0, 1fr); } }

/* IMR-544: the two language versions of an author share an address and photo. */
.imrey-author-form.imrey-author-languages { max-width: 1100px; }
.imrey-author-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-block-start: 24px; }
.imrey-author-profile-grid fieldset { min-width: 0; }
.imrey-author-profile-grid legend { font-weight: 700; margin-block-end: 12px; }
@media (max-width: 700px) { .imrey-author-profile-grid { grid-template-columns: minmax(0, 1fr); } }

/* IMR-597, approved separate «Ещё»: desktop keeps its original tab order; mobile has one action row. */
.imrey-editor-mobile-state, .imrey-editor-mobile-message, .imrey-editor-tools { display: none; }
.imrey-editor-desktop-state { display: contents; }
.imrey-editor-tools { position: relative; }
.imrey-editor-tools-panel { position: absolute; inset-inline-end: 0; bottom: calc(100% + 8px); z-index: 30; width: 224px; max-width: calc(100vw - 16px); padding: 4px; border: 1px solid var(--imrey-border); border-radius: 8px; background: var(--imrey-surface); box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
.imrey-editor-tools-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 5px; background: none; color: var(--imrey-ink); font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.imrey-editor-tools-item svg { width: 16px; height: 16px; flex: none; }
.imrey-editor-tools-item:hover:not(:disabled) { background: var(--imrey-hover); }
.imrey-editor-tools-item:focus-visible { outline: 2px solid var(--imrey-accent); outline-offset: -2px; }
.imrey-editor-tools-item:disabled { opacity: .5; cursor: default; }
@media (max-width: 640px) {
    .imrey-editor-mobile-message { display: block; flex: 1 1 100%; margin: 0; color: var(--imrey-muted); font-size: 13px; }
    .imrey-editor-status-info { display: none; }
    .imrey-editor-mobile-state { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
    .imrey-editor-desktop-state, .imrey-editor-bar-actions > .imrey-editor-tool-desktop { display: none; }
    .imrey-editor-bar { margin-inline: -16px; padding: 8px; padding-block-end: max(8px, env(safe-area-inset-bottom)); row-gap: 0; }
    .imrey-editor-bar-state { flex-basis: 100%; }
    .imrey-editor-bar-state > [role="alert"] { width: 100%; margin: 0 0 8px; padding: 8px 10px; border-radius: 5px; background: var(--imrey-danger-soft); color: var(--imrey-danger); }
    .imrey-editor-bar-actions { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; width: 100%; }
    .imrey-editor-bar-actions > .fi-btn, .imrey-editor-tools > .fi-btn { min-width: 0; min-height: 44px; padding: 7px 10px; font-size: 13px; font-weight: 500; line-height: 18px; white-space: nowrap; }
    .imrey-editor-tools { display: block; grid-column: 3; }
    .imrey-editor-tools > .fi-btn { width: 100%; }
    .imrey-editor-primary { width: 100%; }
}
@media (max-width: 359px) {
    .imrey-editor-bar-actions > .imrey-editor-primary { padding: 4px 6px; line-height: 16px; white-space: normal; }
}
