/* Affronter Conversation Suite BBCode-Lite editor */
.acvs-editor {
    display: grid;
    gap: 12px;
}
.acvs-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(245,243,255,.96));
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
}
.acvs-toolbar__button {
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid rgba(124,58,237,.28);
    border-radius: 10px;
    background: #fff;
    color: #172033;
    font: inherit;
    font-size: .82rem;
    font-weight: 750;
    cursor: pointer;
}
.acvs-toolbar__button:hover,
.acvs-toolbar__button:focus-visible {
    border-color: #7c3aed;
    background: #ede9fe;
}
.acvs-toolbar__button:focus-visible {
    outline: 3px solid rgba(124,58,237,.4);
    outline-offset: 2px;
}
.acvs-editor textarea[name="comment"] {
    width: 100%;
    min-height: 180px;
}
.acvs-editor__counter,
.acvs-editor__help {
    margin: 0;
    color: #64748b;
    font-size: .82rem;
}
@media (max-width: 520px) {
    .acvs-toolbar__button { flex: 1 1 calc(50% - 8px); }
}
@media (prefers-reduced-motion: reduce) {
    .acvs-toolbar__button { transition: none; }
}

/* ACVS CODE WINDOW */
.acvs-code-window {
    overflow: hidden;
    margin: 18px 0;
    border: 1px solid rgba(124, 58, 237, 0.34);
    border-radius: 16px;
    background: #0b1020;
    box-shadow: 0 16px 38px rgba(2, 6, 23, 0.24);
    color: #e5e7eb;
}
.acvs-code-window__header {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(135deg, #111827, #1e1b4b);
}
.acvs-code-window__language {
    color: #c4b5fd;
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.acvs-code-window__pre {
    max-width: 100%;
    max-height: 620px;
    margin: 0;
    padding: 14px 0;
    overflow: auto;
    background: #0b1020;
    color: #e5e7eb;
    font: 500 .88rem/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    tab-size: 4;
    white-space: pre;
    scrollbar-color: #7c3aed #111827;
    scrollbar-width: thin;
}
.acvs-code-window__pre:focus-visible {
    outline: 3px solid #8b5cf6;
    outline-offset: -3px;
}
.acvs-code-window__code {
    display: block;
    min-width: max-content;
}
.acvs-code-window__line {
    display: grid;
    grid-template-columns: 4.2rem minmax(max-content, 1fr);
    min-height: 1.65em;
}
.acvs-code-window__line:nth-child(even) {
    background: rgba(148, 163, 184, 0.035);
}
.acvs-code-window__line:hover {
    background: rgba(124, 58, 237, 0.11);
}
.acvs-code-window__number {
    position: sticky;
    left: 0;
    padding: 0 1rem 0 .75rem;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
    background: #0b1020;
    color: #64748b;
    text-align: right;
    user-select: none;
}
.acvs-code-window__content {
    display: block;
    padding: 0 1rem;
    white-space: pre;
}
@media (max-width: 520px) {
    .acvs-code-window__pre { font-size: .8rem; }
    .acvs-code-window__line { grid-template-columns: 3.4rem minmax(max-content, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .acvs-code-window__line { transition: none; }
}

/* ACVS CODE WINDOW CONTROLS */
.acvs-code-window__header {
    justify-content: space-between;
    gap: 12px;
}
.acvs-code-window__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}
.acvs-code-window__action {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid rgba(196, 181, 253, 0.32);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
    color: #ede9fe;
    font: inherit;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
}
.acvs-code-window__action:hover,
.acvs-code-window__action:focus-visible,
.acvs-code-window__action[aria-pressed="true"] {
    border-color: #c4b5fd;
    background: rgba(124, 58, 237, 0.32);
    color: #fff;
}
.acvs-code-window__action:focus-visible {
    outline: 3px solid rgba(196, 181, 253, 0.48);
    outline-offset: 2px;
}
.acvs-code-window--expanded .acvs-code-window__pre {
    max-height: min(82vh, 980px);
}
.acvs-code-window--wrap .acvs-code-window__pre,
.acvs-code-window--wrap .acvs-code-window__content {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.acvs-code-window--wrap .acvs-code-window__code {
    min-width: 0;
}
.acvs-code-window--wrap .acvs-code-window__line {
    grid-template-columns: 4.2rem minmax(0, 1fr);
}
@media (max-width: 520px) {
    .acvs-code-window__header { align-items: flex-start; flex-direction: column; }
    .acvs-code-window__actions { justify-content: flex-start; }
}

/* ACVS HOW TO USE DIALOG */
.acvs-toolbar__button--help {
    margin-inline-start: auto;
    border-color: rgba(234, 88, 12, 0.32);
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
}
.acvs-help-dialog {
    width: min(760px, calc(100vw - 28px));
    max-height: min(86vh, 880px);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(124, 58, 237, 0.32);
    border-radius: 22px;
    background: #f8fafc;
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.38);
    color: #172033;
}
.acvs-help-dialog::backdrop {
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(5px);
}
.acvs-help-dialog__shell {
    max-height: min(86vh, 880px);
    padding: clamp(18px, 3vw, 28px);
    overflow: auto;
}
.acvs-help-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.acvs-help-dialog__eyebrow {
    margin: 0 0 5px;
    color: #7c3aed;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.acvs-help-dialog h2,
.acvs-help-dialog h3 {
    margin-top: 0;
    color: #111827;
}
.acvs-help-dialog__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(124, 58, 237, 0.24);
    border-radius: 50%;
    background: #fff;
    color: #172033;
    font-size: 1.35rem;
    cursor: pointer;
}
.acvs-help-dialog__language-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 800;
}
.acvs-help-dialog__language {
    width: 100%;
    max-width: 320px;
    min-height: 42px;
    margin-bottom: 22px;
}
.acvs-help-dialog__examples {
    display: grid;
    gap: 12px;
}
.acvs-help-example {
    display: grid;
    grid-template-columns: minmax(110px, .55fr) minmax(0, 1.45fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}
.acvs-help-example code {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #5b21b6;
}
.acvs-help-example__insert,
.acvs-help-dialog__done {
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid rgba(124, 58, 237, 0.28);
    border-radius: 10px;
    background: #ede9fe;
    color: #4c1d95;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.acvs-help-dialog__done {
    margin-top: 20px;
}
.acvs-help-dialog button:focus-visible,
.acvs-help-dialog select:focus-visible {
    outline: 3px solid rgba(124, 58, 237, 0.4);
    outline-offset: 3px;
}
.acvs-help-dialog__panel[dir="rtl"] {
    text-align: right;
}
@media (max-width: 620px) {
    .acvs-toolbar__button--help { margin-inline-start: 0; }
    .acvs-help-example { grid-template-columns: minmax(0, 1fr); }
    .acvs-help-example__insert { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
    .acvs-help-dialog, .acvs-help-example { scroll-behavior: auto; }
}

/* ACVS MARKDOWN MODE */
.acvs-format-switcher {
    display: inline-flex;
    gap: 4px;
    width: fit-content;
    padding: 4px;
    border: 1px solid rgba(124, 58, 237, .24);
    border-radius: 12px;
    background: #f8fafc;
}
.acvs-format-switcher__button,
.acvs-markdown-help-button {
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #334155;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.acvs-format-switcher__button.is-active,
.acvs-format-switcher__button:focus-visible,
.acvs-markdown-help-button:hover,
.acvs-markdown-help-button:focus-visible {
    border-color: rgba(37, 99, 235, .28);
    background: #dbeafe;
    color: #1e40af;
}
.acvs-markdown-help-button { width: fit-content; }
.acvs-markdown-dialog {
    width: min(720px, calc(100vw - 28px));
    max-height: 86vh;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, .3);
    border-radius: 22px;
    background: #f8fafc;
    color: #172033;
    box-shadow: 0 28px 80px rgba(2, 6, 23, .4);
}
.acvs-markdown-dialog::backdrop { background: rgba(2, 6, 23, .72); backdrop-filter: blur(5px); }
.acvs-markdown-dialog__shell { max-height: 86vh; padding: 24px; overflow: auto; }
.acvs-markdown-dialog header { display: flex; justify-content: space-between; gap: 18px; }
.acvs-markdown-dialog header button,
.acvs-markdown-example button,
.acvs-markdown-dialog__done {
    min-height: 36px; padding: 7px 11px; border: 1px solid rgba(37, 99, 235, .28);
    border-radius: 9px; background: #dbeafe; color: #1e40af; font: inherit; font-weight: 800; cursor: pointer;
}
.acvs-markdown-example {
    display: grid; grid-template-columns: minmax(100px, .5fr) minmax(0, 1.5fr) auto;
    gap: 12px; align-items: center; margin-top: 12px; padding: 13px;
    border: 1px solid rgba(148,163,184,.24); border-radius: 14px; background: #fff;
}
.acvs-markdown-example code { white-space: pre-wrap; overflow-wrap: anywhere; color: #1d4ed8; }
.acvs-markdown-dialog__done { margin-top: 18px; }
.acvs-inline-code { padding: 2px 5px; border-radius: 6px; background: #e2e8f0; color: #7c2d12; }
@media (max-width: 620px) { .acvs-markdown-example { grid-template-columns: minmax(0, 1fr); } }

