/* VoxBB editor + content tokens.
   Themes override these on :root (or on a theme scope) instead of editing component CSS.
   Dark values apply for the OS preference and for the theme's explicit dark switch. */
:root {
  --nxe-field: #ffffff;
  --nxe-bar: #f2f3f5;
  --nxe-raise: #ffffff;
  --nxe-line: #dcdfe4;
  --nxe-line-strong: #c5c9d0;
  --nxe-text: #1c1e22;
  --nxe-muted: #626873;
  --nxe-faint: #8b909a;
  --nxe-hover: rgba(20, 24, 32, .06);
  --nxe-press: rgba(20, 24, 32, .1);
  --nxe-primary: #2f78bd;
  --nxe-primary-hover: #2869a7;
  --nxe-on-primary: #ffffff;
  --nxe-link: #1f68b0;
  --nxe-soft: rgba(47, 120, 189, .14);
  --nxe-danger: #c93636;
  --nxe-ok: #1a7f37;
  --nxe-radius: 16px;
  --nxe-shadow: 0 10px 30px rgba(15, 20, 30, .14), 0 2px 6px rgba(15, 20, 30, .08);
  --nxe-font: inherit;
  --nxe-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --nx-code-bg: #f3f4f6;
  --nx-quote-bg: #f6f7f9;
  --nx-tc-red: #cf222e; --nx-tc-orange: #bc4c00; --nx-tc-yellow: #946400; --nx-tc-green: #1a7f37; --nx-tc-teal: #0f766e;
  --nx-tc-blue: #0a5fd1; --nx-tc-purple: #8250df; --nx-tc-pink: #bf3989; --nx-tc-gray: #6e7781;
  --nx-tc-neutral: #6e7781; --nx-tc-amber: #a06000;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --nxe-field: #141517; --nxe-bar: #1f2023; --nxe-raise: #232428; --nxe-line: #2b2d31; --nxe-line-strong: #3b3e44;
    --nxe-text: #e6e5e2; --nxe-muted: #9a9da4; --nxe-faint: #6f737b; --nxe-hover: rgba(255,255,255,.06); --nxe-press: rgba(255,255,255,.1);
    --nxe-primary: #3a86c8; --nxe-primary-hover: #4a95d6; --nxe-link: #72b4ee; --nxe-soft: rgba(90,160,225,.18); --nxe-danger: #f07070; --nxe-ok: #6fcf7c;
    --nxe-shadow: 0 14px 40px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.35);
    --nx-code-bg: #0f1012; --nx-quote-bg: #1c1d20;
    --nx-tc-red: #ff7b72; --nx-tc-orange: #ffa657; --nx-tc-yellow: #e3c35a; --nx-tc-green: #6fcf7c; --nx-tc-teal: #4fd1c5;
    --nx-tc-blue: #79b8ff; --nx-tc-purple: #c297ff; --nx-tc-pink: #f58ac8; --nx-tc-gray: #9aa1a9; --nx-tc-neutral: #9aa1a9; --nx-tc-amber: #e9b04d;
  }
}
:root[data-theme="dark"] {
  --nxe-field: #141517; --nxe-bar: #1f2023; --nxe-raise: #232428; --nxe-line: #2b2d31; --nxe-line-strong: #3b3e44;
  --nxe-text: #e6e5e2; --nxe-muted: #9a9da4; --nxe-faint: #6f737b; --nxe-hover: rgba(255,255,255,.06); --nxe-press: rgba(255,255,255,.1);
  --nxe-primary: #3a86c8; --nxe-primary-hover: #4a95d6; --nxe-link: #72b4ee; --nxe-soft: rgba(90,160,225,.18); --nxe-danger: #f07070; --nxe-ok: #6fcf7c;
  --nxe-shadow: 0 14px 40px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.35);
  --nx-code-bg: #0f1012; --nx-quote-bg: #1c1d20;
  --nx-tc-red: #ff7b72; --nx-tc-orange: #ffa657; --nx-tc-yellow: #e3c35a; --nx-tc-green: #6fcf7c; --nx-tc-teal: #4fd1c5;
  --nx-tc-blue: #79b8ff; --nx-tc-purple: #c297ff; --nx-tc-pink: #f58ac8; --nx-tc-gray: #9aa1a9; --nx-tc-neutral: #9aa1a9; --nx-tc-amber: #e9b04d;
}

/* VoxBB rendered content. Used by posts (server-rendered) AND inside the editor, so what you write is what readers see. */
.nexus-content { color: var(--nxe-text); overflow-wrap: anywhere; line-height: 1.55; }
.nexus-content > *:first-child { margin-top: 0; }
.nexus-content > *:last-child { margin-bottom: 0; }
.nexus-content p { margin: 0 0 .65em; }
.nexus-content h1, .nexus-content h2, .nexus-content h3 { line-height: 1.25; margin: .9em 0 .4em; font-weight: 700; }
.nexus-content h1 { font-size: 1.6em; }
.nexus-content h2 { font-size: 1.32em; }
.nexus-content h3 { font-size: 1.12em; }
.nexus-content ul, .nexus-content ol { padding-left: 1.6em; margin: 0 0 .65em; }
.nexus-content li > p { margin: .15em 0; }
.nexus-content a { color: var(--nxe-link); text-decoration: underline; text-underline-offset: 2px; }
.nexus-content blockquote { margin: .4em 0 .8em; padding: .6em 1em; border-left: 3px solid var(--nxe-primary); background: var(--nx-quote-bg); border-radius: 0 10px 10px 0; }
.nexus-content blockquote[data-author]::before { content: attr(data-author) " said:"; display: block; font-weight: 700; margin-bottom: .35em; }
.nexus-content .nx-quote-head { display: block; font-weight: 700; margin-bottom: .35em; color: var(--nxe-text); text-decoration: none; }
.nexus-content blockquote.nx-quote::before { content: none; }
.nexus-content code { font: .88em/1.4 var(--nxe-mono); background: var(--nx-code-bg); border: 1px solid var(--nxe-line); padding: .08em .35em; border-radius: 5px; }
.nexus-content pre { margin: .4em 0 .8em; background: var(--nx-code-bg); border: 1px solid var(--nxe-line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.nexus-content pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.6; white-space: pre; }
.nexus-content hr { border: 0; border-top: 1px solid var(--nxe-line-strong); margin: 1.1em 0; }
.nexus-content img { display: block; max-width: 100%; height: auto; border-radius: 10px; margin: .3em 0 .7em; }
.nexus-content .nx-mention { color: var(--nxe-link); background: var(--nxe-soft); padding: 0 .3em; border-radius: 5px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.nexus-content .tableWrapper, .nexus-content .nx-table-wrap { overflow-x: auto; margin: .4em 0 .8em; }
.nexus-content table { border-collapse: collapse; min-width: 60%; }
.nexus-content td, .nexus-content th { border: 1px solid var(--nxe-line-strong); padding: 6px 10px; vertical-align: top; position: relative; min-width: 60px; }
.nexus-content th { background: var(--nxe-bar); font-weight: 600; text-align: left; }
.nexus-content td > p, .nexus-content th > p { margin: 0; }
.nexus-content td > p:empty::after, .nexus-content th > p:empty::after { content: "\00a0"; }

.nexus-content .nx-ispoiler { background: var(--nxe-text); color: transparent; border-radius: 4px; padding: 0 .2em; cursor: pointer; transition: color .15s, background .15s; }
.nexus-content .nx-ispoiler.is-shown { background: var(--nxe-hover); color: inherit; }

.nexus-content .nx-box { --bc: var(--nx-tc-neutral); margin: .4em 0 .8em; border: 1px solid color-mix(in srgb, var(--bc) 38%, var(--nxe-line)); background: color-mix(in srgb, var(--bc) 9%, var(--nxe-field)); border-radius: 12px; overflow: hidden; }
.nexus-content .nx-box--blue { --bc: var(--nx-tc-blue); }
.nexus-content .nx-box--green { --bc: var(--nx-tc-green); }
.nexus-content .nx-box--amber { --bc: var(--nx-tc-amber); }
.nexus-content .nx-box--red { --bc: var(--nx-tc-red); }
.nexus-content .nx-box--purple { --bc: var(--nx-tc-purple); }
.nexus-content .nx-box--neutral { background: var(--nx-quote-bg); border-color: var(--nxe-line-strong); }
.nexus-content .nx-box-title, .nexus-content .nx-box > summary { padding: 8px 14px; font-weight: 700; color: color-mix(in srgb, var(--bc) 70%, var(--nxe-text)); border-bottom: 1px solid color-mix(in srgb, var(--bc) 25%, var(--nxe-line)); }
.nexus-content .nx-box > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; border-bottom-color: transparent; }
.nexus-content .nx-box > summary::-webkit-details-marker { display: none; }
.nexus-content .nx-box > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.nexus-content .nx-box[open] > summary { border-bottom-color: color-mix(in srgb, var(--bc) 25%, var(--nxe-line)); }
.nexus-content .nx-box[open] > summary::before { transform: rotate(45deg); }
.nexus-content .nx-box-body { padding: 10px 14px; }
.nexus-content .nx-box-body > *:last-child { margin-bottom: 0; }

.nexus-content .nx-embed { position: relative; max-width: 640px; margin: .4em 0 .8em; border-radius: 12px; overflow: hidden; background: #000; }
.nexus-content .nx-embed--video { aspect-ratio: 16 / 9; }
.nexus-content .nx-embed--audio { background: none; }
.nexus-content .nx-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.nexus-content .nx-embed--audio iframe { height: 152px; }
.nexus-content .nx-embed-link { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border: 1px solid var(--nxe-line-strong); border-radius: 12px; background: var(--nxe-bar); color: var(--nxe-text); text-decoration: none; }

/* hljs token colors follow the palette so code reads well in both modes */
.nexus-content .hljs-comment, .nexus-content .hljs-quote { color: var(--nx-tc-gray); font-style: italic; }
.nexus-content .hljs-keyword, .nexus-content .hljs-selector-tag, .nexus-content .hljs-literal { color: var(--nx-tc-purple); }
.nexus-content .hljs-string, .nexus-content .hljs-regexp, .nexus-content .hljs-addition { color: var(--nx-tc-green); }
.nexus-content .hljs-number, .nexus-content .hljs-symbol, .nexus-content .hljs-bullet { color: var(--nx-tc-orange); }
.nexus-content .hljs-title, .nexus-content .hljs-section { color: var(--nx-tc-blue); }
.nexus-content .hljs-attr, .nexus-content .hljs-attribute, .nexus-content .hljs-property, .nexus-content .hljs-selector-class { color: var(--nx-tc-teal); }
.nexus-content .hljs-built_in, .nexus-content .hljs-type { color: var(--nx-tc-yellow); }
.nexus-content .hljs-variable, .nexus-content .hljs-template-variable, .nexus-content .hljs-tag, .nexus-content .hljs-name, .nexus-content .hljs-deletion { color: var(--nx-tc-red); }
.nexus-content .hljs-meta { color: var(--nx-tc-pink); }
.nexus-content .nx-h1 { font-size: 1.6em; }
.nexus-content .nx-h2 { font-size: 1.32em; }
.nexus-content .nx-h3 { font-size: 1.12em; }
.nexus-content .nx-attach { display: inline-block; }
.nexus-content .nx-attach-missing { color: var(--nxe-muted); font-style: italic; }

/* VoxBB responsive media/layout contract */
.nexus-content::after{content:"";display:block;clear:both}.nexus-content img[data-image-width]{max-width:100%;height:auto}.nexus-content img[data-image-align="left"]{display:block;margin-left:0;margin-right:auto}.nexus-content img[data-image-align="center"]{display:block;margin-left:auto;margin-right:auto}.nexus-content img[data-image-align="right"]{display:block;margin-left:auto;margin-right:0}.nexus-content img[data-image-align="float-left"]{float:left;clear:none;margin:0 1rem .5rem 0}.nexus-content img[data-image-align="float-right"]{float:right;clear:none;margin:0 0 .5rem 1rem}.nexus-content .nx-image-frame{max-width:100%;height:auto}.nexus-content .nx-image-frame>img{display:block;width:100%;max-width:100%;height:auto;margin:0}.nexus-content .nx-image-frame--left{display:block;margin-left:0;margin-right:auto}.nexus-content .nx-image-frame--center{display:block;margin-left:auto;margin-right:auto}.nexus-content .nx-image-frame--right{display:block;margin-left:auto;margin-right:0}.nexus-content .nx-image-frame--float-left{float:left;clear:none;margin:0 1rem .5rem 0}.nexus-content .nx-image-frame--float-right{float:right;clear:none;margin:0 0 .5rem 1rem}.nexus-content .nx-layout,.nexus-content [data-nb-layout]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin:.65em 0 1em;align-items:start;clear:both}.nexus-content .nx-layout--3,.nexus-content [data-nb-layout="3"]{grid-template-columns:repeat(3,minmax(0,1fr))}.nexus-content .nx-layout-cell,.nexus-content [data-nb-layout-cell]{min-width:0}@media(max-width:700px){.nexus-content .nx-layout,.nexus-content .nx-layout--3,.nexus-content [data-nb-layout]{grid-template-columns:1fr}.nexus-content img[data-image-align="float-left"],.nexus-content img[data-image-align="float-right"],.nexus-content .nx-image-frame--float-left,.nexus-content .nx-image-frame--float-right{float:none;display:block;margin:.3em auto .7em}}
