/* Reading and editing share the same saved layout. */
.rich-content { overflow-wrap: anywhere; }
.rich-content hr { height: 0; border: 0; border-top: 1px solid var(--line); margin: 30px 0; clear: both; }
.rich-content blockquote.rt-quote { margin: 24px 0; padding: 22px 26px; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 6px; background: var(--surface-soft, var(--bg)); color: var(--ink); }
.rich-content blockquote.rt-quote p:last-of-type { margin-bottom: 0; }
.rich-content blockquote.rt-quote cite { display: block; font-family: inherit; font-size: 13px; line-height: 1.6; font-style: normal; color: var(--muted); margin-top: 14px; }
.rich-content blockquote.rt-quote cite::before { content: '— '; }
.rich-content .rt-image { box-sizing: border-box; display: block; max-width: 100%; margin-top: 24px; margin-bottom: 24px; padding: 0; border: 0; }
.rich-content .rt-image img { display: block; max-width: 100%; width: 100%; height: auto; margin: 0; border-radius: 4px; border: 1px solid var(--line); box-sizing: border-box; }
.rich-content .rt-width-25 { width: 25%; }
.rich-content .rt-width-50 { width: 50%; }
.rich-content .rt-width-75 { width: 75%; }
.rich-content .rt-width-100 { width: 100%; }
.rich-content .rt-align-left { margin-left: 0; margin-right: auto; }
.rich-content .rt-align-center { margin-left: auto; margin-right: auto; }
.rich-content .rt-align-right { margin-left: auto; margin-right: 0; }
.rich-content .rt-image figcaption { margin: 9px 0 0; font-size: 13px; line-height: 1.6; text-align: center; color: var(--muted); }
.instruction-editor { margin: 26px 0; min-width: 0; }
.instruction-editor .field-label { display: block; font-size: 14px; margin-bottom: 10px; }
.instruction-editor .editor-tools { position: sticky; top: calc(var(--catalogue-header, 84px) + 4px); z-index: 8; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 0; margin: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: 6px 6px 0 0; background: var(--bg); }
.instruction-editor .editor-tool-group { display: flex; align-items: center; gap: 3px; padding: 0 7px; border-right: 1px solid var(--line); }
.instruction-editor .editor-tool-group:last-child { border-right: 0; }
.instruction-editor .editor-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 34px; min-height: 34px; height: 34px; padding: 5px 9px; line-height: 1; font-size: 13px; border: 1px solid transparent; border-radius: 4px; color: var(--ink); background: transparent; transform: none; transition: background-color .15s, border-color .15s; }
.instruction-editor .editor-tools button:hover { transform: none; border-color: var(--line); background: var(--surface-soft, var(--input)); }
.instruction-editor .editor-tools button[aria-pressed=true] { background: color-mix(in srgb, var(--red) 12%, var(--bg)); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); color: var(--red); }
.instruction-editor .editor-tools svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.instruction-editor .editor-tools select { min-height: 34px; height: 34px; width: 145px; padding: 4px 24px 4px 7px; font-size: 13px; border-radius: 4px; }
.instruction-editor .editor-highlight-icon { background: #f5df9b; color: #282421; padding: 3px 4px; }
.instruction-editor .editor-canvas { display: grid; grid-template-columns: minmax(0,1fr) 230px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; }
.instruction-editor .rich-editor { min-width: 0; min-height: 430px; padding: 28px; border: 0; margin: 0; background: var(--input); font-size: 15px; line-height: 1.8; outline-offset: -3px; }
.instruction-editor .rich-editor:focus { box-shadow: none; }
.instruction-editor .rich-editor [style*="background-color"] { color: #282421; }
.instruction-editor .rt-image { cursor: pointer; outline: 2px solid transparent; outline-offset: 4px; transition: outline-color .15s; }
.instruction-editor .rt-image:hover { outline-color: var(--line); transform: none; }
.instruction-editor .rt-image:focus-visible,.instruction-editor .rt-image.editor-image-selected { outline-color: var(--red); }
.instruction-editor .editor-image-panel { display: block; position: sticky; align-self: start; top: calc(var(--catalogue-header, 84px) + var(--editor-tools-height, 70px) + 8px); max-height: calc(100dvh - var(--catalogue-header, 84px) - var(--editor-tools-height, 70px) - 24px); overflow: auto; width: auto; padding: 22px 16px; margin: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface-soft, var(--bg)); }
.instruction-editor .editor-image-panel h3 { font-family: inherit; font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.instruction-editor .editor-image-panel fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.instruction-editor .editor-image-panel .field { margin-bottom: 16px; gap: 6px; font-size: 12px; }
.instruction-editor .editor-image-panel :is(input,select) { min-height: 38px; width: 100%; padding: 7px; font-size: 12px; }
.instruction-editor .editor-image-panel .help { font-size: 12px; line-height: 1.65; }
.instruction-editor [hidden] { display: none !important; }
.instruction-editor .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.editor-quote-form textarea { resize: vertical; }
.editor-quote-form h2 { margin-top: 0; }
@media(max-width:820px) {
 .instruction-editor .editor-canvas { grid-template-columns: minmax(0,1fr); }
 .instruction-editor .editor-image-panel { grid-row: 1; border-left: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
 .instruction-editor .editor-image-panel h3 { margin-bottom: 5px; }
 .instruction-editor .editor-image-panel .help { margin-bottom: 0; }
 .instruction-editor .editor-image-panel fieldset { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
 .instruction-editor .editor-image-panel .field { margin: 0; }
 .instruction-editor .rich-editor { padding: 20px 16px; }
 .instruction-editor .editor-tools { top: calc(var(--catalogue-header, 84px) + 1px); gap: 5px 0; padding: 7px 3px; }
 .instruction-editor .editor-tool-group { padding: 0 4px; }
 .instruction-editor .editor-tools button { padding: 5px 7px; }
 .rich-content blockquote.rt-quote { padding: 18px; }
}
