.hud-markdown { overflow-wrap:anywhere; line-height:1.65; min-width:0; }
.hud-markdown > :first-child { margin-top:0; }
.hud-markdown > :last-child { margin-bottom:0; }
.hud-markdown p { white-space:normal; margin:0 0 .8em; }
.hud-markdown h1,.hud-markdown h2,.hud-markdown h3,.hud-markdown h4,.hud-markdown h5,.hud-markdown h6 { font-size:1.1em; line-height:1.4; margin:1.3em 0 .5em; }
.hud-markdown ul,.hud-markdown ol { padding-inline-start:1.6em; margin:.6em 0; }
.hud-markdown li { margin:.2em 0; }
.hud-markdown li > p { margin:.2em 0; }
.hud-markdown blockquote { border-inline-start:3px solid var(--accent,#885ef0); margin:1em 0; padding:.2em 1em; opacity:.9; }
.hud-markdown code { font-family:Consolas,monospace; background:color-mix(in srgb,currentColor 8%,transparent); border-radius:4px; padding:.1em .25em; }
.hud-markdown pre { overflow:auto; max-width:100%; padding:1em; background:color-mix(in srgb,currentColor 6%,transparent); border-radius:8px; white-space:pre; }
.hud-markdown pre code { padding:0; background:none; }
.hud-markdown table { display:block; max-width:100%; overflow:auto; border-collapse:collapse; margin:1em 0; }
.hud-markdown th,.hud-markdown td { border:1px solid color-mix(in srgb,currentColor 20%,transparent); padding:.4em .7em; min-width:4em; }
.hud-markdown a { color:var(--accent-ink,#885ef0); text-decoration:underline; text-underline-offset:3px; }
.hud-md-editor { position:relative; min-width:0; width:100%; border:1px solid var(--border-subtle,#6d6d80); border-radius:10px; overflow:hidden; background:var(--surface,#161622); color:inherit; font-weight:400; }
.hud-md-editor:focus-within { border-color:var(--accent,#9468ef); outline:2px solid color-mix(in srgb,var(--accent,#9468ef) 25%,transparent); outline-offset:1px; }
.hud-md-editor [hidden] { display:none!important; }
.hud-md-modes { display:flex; gap:4px; padding:6px; border-bottom:1px solid var(--border-subtle,#6d6d80); background:color-mix(in srgb,currentColor 3%,transparent); }
.hud-md-editor button { appearance:none; min-height:32px; padding:5px 9px; margin:0; border:1px solid transparent; border-radius:6px; background:transparent; color:inherit; font:inherit; font-size:.82rem; cursor:pointer; line-height:1.3; box-shadow:none; white-space:nowrap; }
.hud-md-editor button:hover { background:color-mix(in srgb,currentColor 9%,transparent); }
.hud-md-editor button[aria-pressed=true] { background:color-mix(in srgb,var(--accent,#9468ef) 18%,transparent); border-color:color-mix(in srgb,var(--accent,#9468ef) 50%,transparent); }
.hud-md-editor button:focus-visible { outline:2px solid var(--accent,#9468ef); outline-offset:-2px; }
.hud-md-toolbar { display:flex; flex-wrap:wrap; gap:2px; padding:5px 7px; border-bottom:1px solid var(--border-subtle,#6d6d80); }
.hud-md-toolbar button { min-width:32px; }
.hud-md-bold { font-weight:700!important; }
.hud-md-italic { font-style:italic!important; }
.hud-md-content { position:relative; }
.hud-md-content .tiptap { padding:12px 14px; min-height:140px; max-height:480px; overflow:auto; outline:none; }
.hud-md-content .tiptap > :last-child { margin-bottom:0; }
.hud-md-placeholder { position:absolute; inset-inline:14px; top:12px; max-height:118px; overflow:hidden; pointer-events:none; white-space:pre-wrap; color:var(--secondary,inherit); font-size:.9rem; line-height:1.5; }
.hud-md-editor textarea.hud-md-source { display:block; width:100%; min-height:140px; max-height:480px; margin:0; border:0!important; border-radius:0; padding:12px 14px; box-shadow:none!important; background:transparent!important; color:inherit; resize:vertical; font: .9rem/1.6 Consolas,monospace; }
.hud-md-counter { display:block; padding:5px 12px; text-align:end; opacity:.65; font-size:.7rem; border-top:1px solid color-mix(in srgb,currentColor 10%,transparent); }
.hud-md-invalid .hud-md-counter { color:var(--danger,#ef7d7d); opacity:1; }
.hud-md-hint { margin:0!important; padding:8px 12px; font-size:.8rem!important; background:color-mix(in srgb,var(--accent,#9468ef) 10%,transparent); }
.hud-md-link { display:flex; flex-wrap:wrap; gap:6px; padding:8px; border-bottom:1px solid var(--border-subtle,#6d6d80); }
.hud-md-link input { flex:1 1 180px; min-width:0; width:auto; }
.hud-md-link small { flex-basis:100%; color:var(--danger,#ef7d7d); }
@media (prefers-color-scheme:light) { .hud-md-editor { background:var(--surface,#fff); } }
@media(max-width:480px) { .hud-md-toolbar { gap:1px; } .hud-md-toolbar button { min-width:30px; padding-inline:6px; } .hud-md-content { position:relative; }
.hud-md-content .tiptap { padding:10px; } }
