/* POMS profile-editor controls, scoped to the DoPP / PetzU content editor. */
.petz-rich-editor { margin:1rem 0 1.4rem; min-width:0; color:var(--poms-text,#543a2f); font-family:'Comic Sans MS',sans-serif; }
.petz-rich-editor *, .petz-rich-editor *::before, .petz-rich-editor *::after { box-sizing:border-box; }
.petz-rich-editor [hidden] { display:none !important; }
.petz-rich-editor button { width:auto; max-width:100%; height:auto; min-height:36px; margin:0; padding:7px 11px; border:1px solid var(--poms-border,#789367); border-radius:5px; background:var(--poms-panel,#fffaf2); color:var(--poms-text,#543a2f); font:13px 'Comic Sans MS',sans-serif; cursor:pointer; white-space:normal; }
.petz-rich-editor button:disabled { opacity:.55; cursor:default; }
.petz-rich-editor :is(button,input,select,summary):focus-visible { outline:2px solid var(--poms-heading,#4c703f); outline-offset:3px; }
.petz-rich-editor :is(h3,h4) { padding:0; border:0; background:none; color:var(--poms-heading,#4c703f); font-family:'Jua','Comic Sans MS',sans-serif; line-height:1.25; text-align:left; }
.petz-rich-editor h3 { margin:0 0 12px; font-size:24px; }
.petz-rich-editor h4 { margin:0 0 12px; font-size:20px; }
.petz-rich-editor label { display:block; margin:0 0 12px; color:inherit; font-size:14px; }
.petz-rich-editor input:not([type=hidden]):not([type=color]), .petz-rich-editor select { display:block; width:100%; max-width:100%; min-width:0; margin:5px 0 0; padding:8px; border:1px solid var(--poms-border,#789367); border-radius:5px; background:#fffdf7; color:var(--poms-text,#543a2f); font:inherit; }
.petz-rich-editor input[type=color] { display:block; width:100%; height:34px; margin:5px 0 0; padding:2px; border:1px solid var(--poms-border,#789367); background:#fffdf7; }
.petz-rich-tabs { display:flex; gap:6px; margin:0 0 20px; border-bottom:1px solid var(--poms-border,#789367); }
.petz-rich-tabs button { border-radius:8px 8px 0 0; border-bottom:0; padding:10px 18px; background:var(--poms-card-peach,#f6e4d5); }
.petz-rich-tabs button[aria-selected=true] { background:var(--poms-card-sage,#eef3e5); font-weight:bold; box-shadow:inset 0 3px var(--poms-border,#789367); }
.petz-rich-workspace { display:grid; grid-template-columns:minmax(0,1fr) 225px; align-items:start; gap:20px; }
.petz-rich-writing { min-width:0; }
.petz-rich-editor .petz-rich-controls { position:static; float:none; width:auto; min-width:0; margin:0; padding:16px; border:1px solid var(--poms-border,#789367); border-radius:10px; background:var(--poms-card-sage,#eef3e5); color:inherit; box-shadow:none; }
.petz-rich-toolbar { display:flex; flex-wrap:wrap; gap:4px; padding:10px; background:var(--poms-card-peach,#f6e4d5); border:1px solid var(--poms-border,#789367); border-bottom:0; border-radius:8px 8px 0 0; }
.petz-rich-toolbar button { min-width:36px; }
.petz-rich-editor button[aria-pressed=true] { background:var(--poms-heading,#4c703f); color:#fffaf2; }
.petz-rich-mount { padding:16px; border:1px solid var(--poms-border,#789367); border-radius:0 0 8px 8px; background:#fffdf9; color:#543a2f; }
.petz-rich-mount .tiptap { display:flow-root; min-height:280px; outline:none; line-height:1.6; overflow-wrap:anywhere; }
.petz-rich-mount:focus-within { outline:2px solid var(--poms-border,#789367); outline-offset:1px; }
.petz-rich-editor textarea[data-rich-input] { display:block; width:100%; min-height:320px; padding:16px; border:1px solid var(--poms-border,#789367); border-radius:8px; resize:vertical; background:#fffdf9; color:#543a2f; font:14px/1.6 monospace; white-space:pre-wrap; }
.petz-rich-insert, .petz-rich-editor .petz-rich-image-selected { min-width:0; margin:14px 0; padding:14px; border:1px dashed var(--poms-border,#789367); border-radius:8px; background:transparent; }
.petz-rich-add-image { background:var(--poms-panel,#fffaf2); }
.petz-rich-image-choices { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 12px; }
.petz-rich-image-selected legend { padding:0 4px; font-weight:bold; }
.petz-rich-source-tools { margin-top:18px; padding-top:14px; border-top:1px dashed var(--poms-border,#789367); }
.petz-rich-more { margin:14px 0; }
.petz-rich-more summary { margin-bottom:10px; cursor:pointer; }
.petz-rich-more button { margin:0 0 6px; }
.petz-rich-editor .petz-rich-note { margin:8px 0 16px; padding:0; background:transparent; color:inherit; font:13px/1.5 'Comic Sans MS',sans-serif; }
.petz-rich-preview { display:flow-root; min-height:320px; padding:20px; border:1px solid var(--poms-border,#789367); border-radius:8px; background:#fffdf9; color:#543a2f; overflow-wrap:anywhere; }
:is(.petz-rich-preview,.petz-rich-mount) p { margin:0 0 .8em; padding:0; background:transparent; color:inherit; line-height:1.6; }
:is(.petz-rich-preview,.petz-rich-mount,.petz-rich-content) img { max-width:100%; height:auto; }
:is(.petz-rich-preview,.petz-rich-mount,.petz-rich-content) pre { overflow-x:auto; padding:.65rem; background:var(--poms-card-sage,#eef3e5); }
:is(.petz-rich-preview,.petz-rich-mount,.petz-rich-content) blockquote { margin:.7rem 0; padding-left:1rem; border-left:3px solid var(--poms-border,#789367); }
:is(.petz-rich-preview,.petz-rich-mount,.petz-rich-content) ul { padding-left:24px; list-style:disc outside; }
:is(.petz-rich-preview,.petz-rich-mount,.petz-rich-content) ol { padding-left:24px; list-style:decimal outside; }
:is(.petz-rich-preview,.petz-rich-mount,.petz-rich-content) li { margin:.2rem 0; }
:is(.petz-rich-preview,.petz-rich-mount) :is(h1,h2,h3,h4,h5,h6) { margin:.75em 0 .4em; padding:0; border:0; background:transparent; text-align:inherit; }
:is(.petz-rich-preview,.petz-rich-mount) h1 { font-size:32px; }
:is(.petz-rich-preview,.petz-rich-mount) h2 { font-size:26px; }
:is(.petz-rich-preview,.petz-rich-mount) h3 { font-size:21px; }
.petz-rich-mount .ProseMirror-selectednode { outline:3px solid var(--poms-border,#789367); outline-offset:3px; }
.petz-rich-content { overflow-wrap:anywhere; }
:is(.petz-rich-mount,.petz-rich-preview,.petz-rich-content) img[data-wrap] { display:block; height:auto; clear:both; }
:is(.petz-rich-mount,.petz-rich-preview,.petz-rich-content) img[data-wrap=none][data-align=left] { margin-left:0; margin-right:auto; }
:is(.petz-rich-mount,.petz-rich-preview,.petz-rich-content) img[data-wrap=none][data-align=center] { margin-left:auto; margin-right:auto; }
:is(.petz-rich-mount,.petz-rich-preview,.petz-rich-content) img[data-wrap=none][data-align=right] { margin-left:auto; margin-right:0; }
:is(.petz-rich-mount,.petz-rich-preview,.petz-rich-content) img[data-wrap=left] { float:left; clear:none; max-width:45%; margin:0 16px 12px 0; }
:is(.petz-rich-mount,.petz-rich-preview,.petz-rich-content) img[data-wrap=right] { float:right; clear:none; max-width:45%; margin:0 0 12px 16px; }
.petz-rich-content:has(img[data-wrap]) { display:flow-root; }
.petz-rich-editor .petz-rich-image-dialog { position:fixed; inset:0; width:min(720px,calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); margin:auto; padding:24px; overflow-y:auto; background:var(--poms-panel,#fffaf2); color:var(--poms-text,#543a2f); border:1px solid var(--poms-border,#789367); border-radius:12px; box-shadow:5px 5px 0 #00000024; }
.petz-rich-image-dialog::backdrop { background:#29382b80; }
.petz-rich-dialog-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; }
.petz-rich-dialog-heading strong { font:24px 'Jua','Comic Sans MS',sans-serif; }
.petz-rich-image-dialog [data-picker-tab][aria-selected=true] { background:var(--poms-heading,#4c703f); color:#fffaf2; }
.petz-rich-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(140px,100%),1fr)); gap:12px; }
.petz-rich-gallery .petz-rich-image-choice { display:flex; flex-direction:column; align-items:center; gap:8px; width:100%; min-width:0; padding:12px; background:#fffdf7; }
.petz-rich-image-choice img { display:block; width:auto; height:auto; max-width:100%; max-height:120px; object-fit:contain; }
.petz-rich-image-choice span { max-width:100%; overflow-wrap:anywhere; font-size:12px; }
@media(max-width:1100px) { .petz-rich-workspace { grid-template-columns:1fr; } }
@media(max-width:640px) {
 .petz-rich-toolbar { padding:6px; }
 .petz-rich-toolbar button { min-height:40px; }
 .petz-rich-editor .petz-rich-image-dialog { padding:16px; }
 :is(.petz-rich-mount,.petz-rich-preview,.petz-rich-content) img[data-wrap=left], :is(.petz-rich-mount,.petz-rich-preview,.petz-rich-content) img[data-wrap=right] { float:none; clear:both; max-width:100%; margin:0 auto 12px; }
}
