/* Shared editor and renderer, independent of a specific message provider. */
.bbcode-editor { min-width:0; margin:.85rem 0; }
.bbcode-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem .7rem; padding:.55rem; border:1px solid var(--line); border-bottom:0; border-radius:5px 5px 0 0; background:#24251f; }
.bbcode-toolbar[hidden],.bbcode-editor [hidden] { display:none; }
.bbcode-tool-row { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem .7rem; width:100%; min-width:0; }
.bbcode-tool-group { display:flex; flex-wrap:wrap; align-items:center; gap:.25rem; }
.bbcode-toolbar button { min-height:1.9rem; margin:0; padding:.3rem .5rem; border:1px solid #65635a; border-radius:3px; background:#171a15; color:var(--ink); box-shadow:none; font:400 .78rem/1.2 var(--font-control); }
.bbcode-toolbar button:hover:not(:disabled) { border-color:var(--accent); color:var(--accent); filter:none; }
:is(.bbcode-align-button,.bbcode-icon-button) svg { display:block; width:1.1rem; height:1.1rem; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.bbcode-toolbar button:disabled { opacity:.4; background:#171a15; color:var(--muted); }
.bbcode-toolbar :is(button,select,input):focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.bbcode-toolbar label { display:flex; margin:0; padding:0; }
.bbcode-toolbar select { box-sizing:border-box; min-height:1.9rem; margin:0; padding:.25rem .35rem; border:1px solid #65635a; border-radius:3px; background:#171a15; color:var(--ink); font:400 .78rem var(--font-control); color-scheme:dark; }
.bbcode-toolbar input[type=color] { box-sizing:border-box; width:2rem; height:1.9rem; padding:.15rem; margin:0; border:1px solid #65635a; border-radius:3px; background:#171a15; cursor:pointer; }
.bbcode-editor [data-bbcode-input] { display:block; box-sizing:border-box; width:100%; min-height:16rem; margin:0; padding:.7rem; resize:vertical; border:1px solid var(--line); border-radius:0 0 5px 5px; background:#141712; color:var(--ink); font:400 .85rem/1.6 var(--font-body); color-scheme:dark; tab-size:4; }
.bbcode-editor.is-expanded [data-bbcode-input] { min-height:32rem; }
.bbcode-editor-footer { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:.35rem .5rem; margin:.4rem 0; color:var(--muted); font-size:.72rem; }
.bbcode-editor-footer [data-bbcode-status] { grid-area:1 / 1; min-width:0; }
.bbcode-editor-footer .bbcode-shortcut { grid-area:1 / 3; justify-self:end; text-align:right; }
.bbcode-editor-footer .bbcode-help,.bbcode-editor-footer .bbcode-help::details-content { display:contents; }
.bbcode-editor-footer .bbcode-help > summary { grid-area:1 / 2; }
.bbcode-editor-footer .bbcode-help > :not(summary) { grid-column:1 / -1; }
.bbcode-editor-footer .bbcode-help:not([open]) > :not(summary) { display:none; }
.bbcode-help { color:var(--muted); font-size:.76rem; }
.bbcode-help > summary { width:max-content; max-width:100%; cursor:pointer; color:var(--accent); }
.bbcode-help p { font-size:inherit; line-height:1.6; }
.bbcode-help dl > div { display:grid; grid-template-columns:8.5rem minmax(0,1fr); gap:.5rem; margin:.5rem 0; }
.bbcode-help dd { margin:0; overflow-wrap:anywhere; }
.bbcode-dialog { box-sizing:border-box; width:24rem; max-width:calc(100% - 2rem); max-height:calc(100% - 2rem); overflow:auto; padding:1.1rem; border:1px solid var(--line); border-radius:6px; background:#181c17; color:var(--ink); box-shadow:0 12px 40px #0009; }
.bbcode-dialog::backdrop { background:#0008; }
.bbcode-dialog h3 { margin:0 0 1rem; font:400 1.15rem var(--font-heading); }
.bbcode-dialog label { display:grid; gap:.35rem; margin:.7rem 0; }
.bbcode-dialog input { box-sizing:border-box; width:100%; margin:0; padding:.5rem; background:#10140f; border:1px solid var(--line); color:var(--ink); font:inherit; border-radius:4px; }
.bbcode-dialog p { font-size:.8rem; color:var(--muted); }
.bbcode-dialog [role=alert] { color:tomato; }
.bbcode-dialog-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:.6rem; margin-top:1rem; }
.bbcode-content { white-space:normal; overflow-wrap:anywhere; line-height:1.7; }
/* Override the game's global block-style strong and page font rules. */
.bbcode-content.bbcode-content strong { display:inline; margin:0; color:inherit; font-size:inherit; }
.bbcode-toolbar.bbcode-toolbar strong { display:inline; margin:0; color:inherit; font-size:inherit; }
.bbcode-content table.bbcode-table { font:inherit; }
.bbcode-underline { text-decoration:underline; }
.bbcode-font-sans { font-family:Arial,Verdana,sans-serif; }
.bbcode-font-serif { font-family:Georgia,'Times New Roman',serif; }
.bbcode-font-mono { font-family:ui-monospace,'Courier New',monospace; }
.bbcode-size-small,.bbcode-size-10 { font-size:10px; }
.bbcode-size-8 { font-size:8px; }.bbcode-size-9 { font-size:9px; }.bbcode-size-11 { font-size:11px; }
.bbcode-size-12 { font-size:12px; }.bbcode-size-13 { font-size:13px; }.bbcode-size-normal,.bbcode-size-14 { font-size:14px; }
.bbcode-size-15 { font-size:15px; }.bbcode-size-16 { font-size:16px; }.bbcode-size-17 { font-size:17px; }
.bbcode-size-large,.bbcode-size-18 { font-size:18px; }.bbcode-size-19 { font-size:19px; }.bbcode-size-20 { font-size:20px; }
.bbcode-size-21 { font-size:21px; }.bbcode-size-22 { font-size:22px; }.bbcode-size-23 { font-size:23px; }.bbcode-size-24 { font-size:24px; }
.bbcode-size-25 { font-size:25px; }.bbcode-size-26 { font-size:26px; }.bbcode-size-27 { font-size:27px; }.bbcode-size-28 { font-size:28px; }
.bbcode-size-29 { font-size:29px; }.bbcode-size-30 { font-size:30px; }.bbcode-size-31 { font-size:31px; }.bbcode-size-32 { font-size:32px; }
.bbcode-size-33 { font-size:33px; }.bbcode-size-34 { font-size:34px; }.bbcode-size-35 { font-size:35px; }.bbcode-size-36 { font-size:36px; }
.bbcode-size-37 { font-size:37px; }.bbcode-size-38 { font-size:38px; }.bbcode-size-39 { font-size:39px; }.bbcode-size-40 { font-size:40px; }
.bbcode-size-41 { font-size:41px; }.bbcode-size-42 { font-size:42px; }.bbcode-size-43 { font-size:43px; }.bbcode-size-44 { font-size:44px; }
.bbcode-size-45 { font-size:45px; }.bbcode-size-46 { font-size:46px; }.bbcode-size-47 { font-size:47px; }.bbcode-size-48 { font-size:48px; }
.bbcode-align-left { text-align:left; }.bbcode-align-center { text-align:center; }.bbcode-align-right { text-align:right; }.bbcode-align-justify { text-align:justify; }
.bbcode-quote { margin:.8rem 0; padding:.7rem 1rem; border-left:3px solid #9d8c59; background:#bca5680a; }
.bbcode-quote-author { margin-bottom:.4rem; color:var(--muted); font-size:.85em; }
.bbcode-code { box-sizing:border-box; max-width:100%; overflow:auto; margin:.75rem 0; padding:.8rem; border:1px solid #65635a; border-radius:4px; background:#0d110e; white-space:pre; font:400 .85rem/1.6 ui-monospace,monospace; }
.bbcode-code code { font:inherit; }
.bbcode-list { margin:.7rem 0; padding-inline-start:1.6rem; }
.bbcode-table-wrap { max-width:100%; overflow-x:auto; margin:.75rem 0; }
.bbcode-table { width:100%; border-collapse:collapse; }
.bbcode-table :is(td,th) { padding:.45rem .65rem; border:1px solid #65635a; text-align:left; overflow-wrap:anywhere; }
.bbcode-table th { background:#bca5680a; }
.bbcode-rule { margin:1rem 0; border:0; border-top:1px solid var(--line); }
.bbcode-spoiler { margin:.75rem 0; padding:.6rem .8rem; border:1px solid #65635a; border-radius:4px; }
.bbcode-spoiler > summary { color:var(--accent); cursor:pointer; }
.bbcode-spoiler > div { margin-top:.7rem; }
.bbcode-image { display:block; max-width:100%; margin:.6rem 0; }
.bbcode-image-load { background:#24251f; border:1px solid #65635a; color:var(--ink); padding:.4rem .6rem; font:inherit; }
.bbcode-image img { display:block; max-width:100%; height:auto; max-height:70vh; object-fit:contain; }
.bbcode-content .bbcode-tier-icon { display:inline-block; width:12px; height:12px; max-width:none; margin:0 .1em; vertical-align:middle; }
@media(max-width:480px){.bbcode-toolbar { gap:.4rem; padding:.4rem; }.bbcode-help dl > div { grid-template-columns:1fr; gap:.15rem; }.bbcode-editor-footer .bbcode-shortcut { display:none; }}
