/* Styles for md-editor.js — our own WYSIWYG editor.
   The .md-rendered rules also style any container that shows mdToHtml() output
   (guest-book list, showcase/registry SSR, gbadmin moderator chat). */

.md-editor { border:1px solid #ced4da; border-radius:.5rem; overflow:hidden; background:#fff; margin-bottom:.25rem; }
.md-editor:focus-within { border-color:#86b7fe; box-shadow:0 0 0 .2rem rgba(13,110,253,.15); }

.md-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:.1rem; padding:.35rem .5rem; background:#f6f8fa; border-bottom:1px solid #e5e7eb; }
.md-btn { border:0; background:transparent; border-radius:.35rem; min-width:2rem; height:2rem; padding:0 .3rem; display:inline-flex; align-items:center; justify-content:center; color:#374151; cursor:pointer; font-size:.95rem; line-height:1; }
.md-btn:hover { background:#e5e9ef; }
.md-btn.hlabel { font-weight:700; font-size:.8rem; }
.md-sep { width:1px; align-self:stretch; margin:.25rem .3rem; background:#dde1e6; }

/* The editable surface. */
.md-input { padding:.6rem .75rem; min-height:9.5rem; outline:0; font-size:1rem; overflow-wrap:break-word; }
.md-input:empty:before { content:attr(data-placeholder); color:#8a9099; }
.md-input > :first-child { margin-top:0; }

/* Compact variant (mirrors Bootstrap's form-control-sm) for tight admin cards. */
.md-editor.md-sm .md-toolbar { padding:.2rem .3rem; }
.md-editor.md-sm .md-btn { height:1.7rem; min-width:1.7rem; font-size:.85rem; }
.md-editor.md-sm .md-input { min-height:5rem; font-size:.9rem; }

/* Rendered markdown — the editable surface AND read-only display containers. */
.md-rendered h2 { font-size:1.4rem; }
.md-rendered h3 { font-size:1.15rem; }
.md-rendered ul, .md-rendered ol { margin:0 0 .5rem; padding-left:1.4rem; }
.md-rendered blockquote { margin:0 0 .5rem; padding:.15rem .9rem; border-left:.25rem solid #d0d7de; color:#57606a; }
.md-rendered code { background:#eff1f3; padding:.1em .35em; border-radius:.25rem; font-size:.9em; }
.md-rendered hr { margin:.75rem 0; border:0; border-top:1px solid #d0d7de; }
.md-rendered a { word-break:break-word; }
.md-rendered :last-child { margin-bottom:0; }

/* Keep rendered chat bubbles readable on the dark (sent) side in gbadmin. */
.bg-primary .md-rendered code { background:rgba(255,255,255,.25); }
.bg-primary .md-rendered blockquote { border-left-color:rgba(255,255,255,.5); color:inherit; }
.bg-primary .md-rendered a { color:#fff; text-decoration:underline; }
