@font-face {
    font-family: 'opendyslexicregular';
    src: url('fonts/opendyslexic-regular-webfont.woff2') format('woff2'),
    url('fonts/opendyslexic-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


/* General Styling */
body {
    background-color: #454545;
    margin: 0;
    font-family: opendyslexicregular, Arial, sans-serif;
    text-align: center;
    font-size: calc(1vw + 1vh);
    color: white;
    overflow-x: hidden;
}

/* Vignette Effect */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 200px rgba(0,0,0,0.9) inset;
    z-index: -2;
}

/* Button Styling */
button {
    font-family: inherit;
    font-size: 1.2em;
    background-color: black;
    border: 5px solid rgb(51, 51, 51);
    border-radius: 15px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: black 5px 5px 20px 1px;
    padding: 10px 15px;
    text-align: center;
    min-width: 150px;
    transition: transform 0.2s ease-in-out;
}

.top-links a {
    color: white;
    text-decoration: none;
}

/* Hover Effect */
h1:hover, h4:hover, h5:hover, h6:hover, button:hover {
    transform: rotate(2deg) scale(1.1);
}

@media screen and (max-width: 480px) {
    body {
        font-size: calc(1.5vw + 1.5vh) !important;
    }
}





.top-satus-text {
    margin: 0;

}


.bot-stuff {
    height: fit-content;
}

.bot-controls-sub-div {
    gap: 5px;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 1%;
    row-gap: 10px;

}

.bot-controls-div {
    background-color: black;
    border: 5px solid rgb(51, 51, 51);
    border-radius: 15px;
    box-shadow: black 5px 5px 20px 1px;

    transition: transform 0.2s ease-in-out;

    width: 40%;

    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1%;
    padding-bottom: 1%;
}


.sub-panel {
    background-color: black;
    border: 5px solid rgb(51, 51, 51);
    border-radius: 15px;
    box-shadow: black 5px 5px 20px 1px;

    transition: transform 0.2s ease-in-out;

    width: 80%;

    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1%;
    padding-bottom: 1%;
    margin-left: auto;
    margin-right: auto;
}
.response-panel {
    background-color: black;
    border: 5px solid rgb(51, 51, 51);
    border-radius: 15px;
    box-shadow: black 5px 5px 20px 1px;

    transition: transform 0.2s ease-in-out;

    width: 90%;

    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding-top: 1%;
    padding-bottom: 1%;
    margin-left: auto;
    margin-right: auto;
}


/* collapsible panels stuff */
.collapsible-panel {
    cursor: pointer;
    color: white;

    max-width: 90%;
    width: 100%;
    min-width: fit-content;
    min-height: fit-content;

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;

    align-items: center;
    justify-content: center;
}
.collapsible-panel-button-text {
    color: white;
    font-size: 0.75em;
}
.blank-space-above-and-below-toggles {
    height: 10px;
}
.panel-hidden {
    display: none;
}
.collapsible-panel:after {
    content: ' ▼';
}
.collapsible-panel.collapsed:after {
    content: ' ▶';
}

@media screen and (max-width: 480px) {
    .blank-space-above-and-below-toggles {
        height: 15px;
    }
}


/* things */

.showing-new-window-button {
    color: white;
    font-size: 0.625em;
    width: 90%;
    text-align: center;
}

.chat-alerts-input, .add-eight-ball-responce-input, .gpt-prompts-input {
    font-family: inherit;
    font-size: 1em;
    background-color: black;
    border: 5px solid rgb(51, 51, 51);
    border-radius: 15px;
    white-space: nowrap;
    box-shadow: black 5px 5px 20px 1px;
    text-align: center;
    width: 80%;

    color: white;
}

.permissions-selection {
    font-family: inherit;
    font-size: 1em;
    background-color: black;
    border: 5px solid rgb(51, 51, 51);
    border-radius: 15px;
    white-space: nowrap;
    box-shadow: black 5px 5px 20px 1px;
    text-align: center;
    width: 80%;
    color: white;
    margin-top: 1%;
    margin-bottom: 1%;
}
.permissions-selection-label {
    font-family: inherit;
    font-size: 0.75em;
    color: white;
}

/* Button Styling */
.chat-alerts-input-submit-button, .chat-alerts-input-reset-button,
.add-eight-ball-response-input-submit-button, .add-eight-ball-response-input-reset-button,
.gpt-prompts-input-submit-button, .gpt-prompts-input-reset-button,
.response-panel-button, .moderation-input, .moderation-input-submit-button,
.moderation-input-reset-button {
    font-family: inherit;
    font-size: 1em;
    background-color: black;
    border: 5px solid rgb(51, 51, 51);
    border-radius: 15px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: black 5px 5px 20px 1px;
    padding: 10px 15px;
    text-align: center;
    min-width: 150px;
    transition: transform 0.2s ease-in-out;
    color: white;
}

.bot-controls-div-top {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 600px;
    max-height: 80vh;

    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #000;
    border-radius: 8px;
    padding: 20px;

    overflow-y: auto;
    z-index: 9999;

    display: none; /* important → hidden by default */
    color: white;
}

button {
    color: white;
}

/*#config-window > * {*/
/*    margin-bottom: 1rem;*/
/*}*/


/* ==========================================================================
   User-friendly NioBot settings dashboard
   Everything below is scoped to .bot-stuff so the rest of the site keeps its
   existing visual style.
   ========================================================================== */

.bot-stuff {
    --bot-surface: #171717;
    --bot-surface-raised: #202020;
    --bot-border: #4a4a4a;
    --bot-border-strong: #666;
    --bot-text: #f5f5f5;
    --bot-muted: #bdbdbd;
    --bot-focus: #ffffff;
    width: min(1400px, calc(100% - 32px));
    margin: 28px auto 56px;
    height: auto;
    text-align: left;
    font-size: 16px;
}

.bot-stuff *, .bot-stuff *::before, .bot-stuff *::after { box-sizing: border-box; }

.bot-stuff button:hover,
.bot-stuff h1:hover, .bot-stuff h2:hover, .bot-stuff h3:hover,
.bot-stuff h4:hover, .bot-stuff h5:hover, .bot-stuff h6:hover { transform: none; }

.bot-dashboard-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
    gap: 24px;
    align-items: end;
    margin-bottom: 20px;
    padding: 22px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid var(--bot-border);
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.bot-dashboard-heading h2 { margin: 0 0 6px; font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.2; }
.bot-dashboard-heading p { margin: 0; color: var(--bot-muted); line-height: 1.55; }

.bot-dashboard-status {
    display: grid;
    justify-items: start;
    gap: 7px;
    margin: 0 0 28px;
}

.bot-runtime-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--bot-border);
    border-radius: 999px;
    background: #111;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.bot-status-dot {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-radius: 50%;
    background: #8a8a8a;
    box-shadow: 0 0 0 3px rgba(138, 138, 138, 0.12);
}

.bot-runtime-status.is-online { color: #73e68b; border-color: rgba(69, 190, 94, 0.55); }
.bot-runtime-status.is-online .bot-status-dot { background: #45be5e; box-shadow: 0 0 0 3px rgba(69, 190, 94, 0.14); }
.bot-runtime-status.is-rebooting { color: #ffbd66; border-color: rgba(230, 145, 42, 0.58); }
.bot-runtime-status.is-rebooting .bot-status-dot { background: #e6912a; box-shadow: 0 0 0 3px rgba(230, 145, 42, 0.14); }
.bot-runtime-status.is-offline,
.bot-runtime-status.is-unknown { color: #ff7b7b; border-color: rgba(218, 73, 73, 0.58); }
.bot-runtime-status.is-offline .bot-status-dot,
.bot-runtime-status.is-unknown .bot-status-dot { background: #da4949; box-shadow: 0 0 0 3px rgba(218, 73, 73, 0.14); }
.bot-runtime-status.is-checking { color: var(--bot-muted); }

.bot-mod-status {
    max-width: 700px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.45;
}
.bot-mod-status[hidden] { display: none !important; }
.bot-mod-status.is-warning {
    color: #ffd394;
    background: rgba(153, 88, 18, 0.15);
    border: 1px solid rgba(230, 145, 42, 0.42);
}
.bot-mod-status.is-unknown {
    color: var(--bot-muted);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--bot-border);
}
.bot-dashboard-tools { display: grid; grid-template-columns: 1fr; gap: 8px; }
.bot-settings-search-label { font-size: 0.82rem; color: var(--bot-muted); }

.bot-settings-search,
.bot-stuff input[type="text"], .bot-stuff input[type="number"],
.bot-stuff input[type="search"], .bot-stuff select, .bot-stuff textarea {
    width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px;
    font-family: inherit; font-size: 0.95rem; color: var(--bot-text);
    background: #101010; border: 1px solid var(--bot-border); border-radius: 10px;
    box-shadow: none; text-align: left; outline: none;
}

.bot-stuff input:focus-visible, .bot-stuff select:focus-visible,
.bot-stuff textarea:focus-visible, .bot-stuff button:focus-visible {
    outline: 3px solid var(--bot-focus); outline-offset: 2px;
}

.bot-dashboard-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.bot-dashboard-buttons button, .bot-stuff .showing-new-window-button,
.bot-stuff input[type="submit"], .bot-stuff input[type="reset"],
.bot-stuff .response-panel-button, #config-window button {
    min-width: 0; min-height: 42px; padding: 9px 14px; font-family: inherit;
    font-size: 0.88rem; color: var(--bot-text); background: #111;
    border: 1px solid var(--bot-border-strong); border-radius: 10px; box-shadow: none;
    cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease;
}

.bot-dashboard-buttons button:hover, .bot-stuff .showing-new-window-button:hover,
.bot-stuff input[type="submit"]:hover, .bot-stuff input[type="reset"]:hover,
.bot-stuff .response-panel-button:hover, #config-window button:hover {
    background: #2b2b2b; border-color: #8a8a8a;
}

.bot-settings-search-status { min-height: 1.2em; color: var(--bot-muted); font-size: 0.78rem; }

.bot-controls-sub-div {
    width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px; align-items: start;
}
.bot-controls-sub-div > br { display: none; }

.bot-controls-div {
    width: auto; min-width: 0; padding: 0; display: block; overflow: hidden;
    background: var(--bot-surface); border: 1px solid var(--bot-border); border-radius: 16px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bot-controls-div:hover { border-color: var(--bot-border-strong); }
.bot-controls-div.is-open { grid-column: 1 / -1; box-shadow: 0 16px 42px rgba(0,0,0,.32); }
.bot-controls-div[hidden] { display: none !important; }

.bot-controls-div > button.collapsible-panel {
    width: 100%; max-width: none; min-width: 0; min-height: 78px; margin: 0;
    padding: 16px 52px 16px 18px; display: grid; grid-template-columns: 1fr; gap: 4px;
    align-content: center; justify-items: start; position: relative; color: var(--bot-text);
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
    text-align: left; white-space: normal;
}
.bot-controls-div > button.collapsible-panel:hover { background: var(--bot-surface-raised); }
.bot-controls-div > button.collapsible-panel::after {
    content: "−"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; display: grid; place-items: center;
    border: 1px solid var(--bot-border); border-radius: 999px;
    color: var(--bot-muted); font-size: 1.2rem; line-height: 1;
}
.bot-controls-div > button.collapsible-panel.collapsed::after { content: "+"; }

.bot-controls-div .collapsible-panel-button-text {
    margin: 0; color: var(--bot-text); font-size: 1.02rem; font-weight: 700; line-height: 1.3;
}
.bot-section-description { color: var(--bot-muted); font-size: 0.78rem; font-weight: 400; line-height: 1.4; }
.panel-hidden { display: none !important; }

.bot-controls-div > .toggle-panel {
    padding: 18px; border-top: 1px solid #353535; background: #131313;
}
.bot-controls-div > .toggle-panel > br,
.bot-controls-div > .toggle-panel > .blank-space-above-and-below-toggles,
.bot-stuff .sub-panel > br { display: none; }

.bot-stuff .toggle-switches {
    width: 100%; min-width: 0; margin: 0 0 12px; padding: 13px 14px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px;
    align-items: center; background: var(--bot-surface-raised);
    border: 1px solid #393939; border-radius: 12px;
}
.bot-stuff .toggle-switches > h6 { margin: 0; font-size: 0.92rem; line-height: 1.4; font-weight: 600; }
.bot-stuff .toggle-switches > br { display: none; }
.bot-stuff .toggle-switches > .range-div,
.bot-stuff .toggle-switches > .permissions-selection-label,
.bot-stuff .toggle-switches > .permissions-selection,
.bot-stuff .toggle-switches > .sub-panel,
.bot-stuff .toggle-switches > label:not(.switch),
.bot-stuff .toggle-switches > .response-panel { grid-column: 1 / -1; }
.bot-stuff .switch { margin: 0; flex: 0 0 auto; }

.bot-stuff .range-div {
    width: 100%; padding: 12px; display: grid; gap: 8px; background: #181818;
    border: 1px solid #343434; border-radius: 10px;
}
.bot-stuff .range-div label, .bot-stuff .permissions-selection-label {
    display: block; margin: 0; color: var(--bot-muted); font-size: 0.82rem; line-height: 1.45;
}
.bot-stuff input[type="range"] { width: 100%; margin: 2px 0; }
.bot-stuff .permissions-selection {
    width: 100%; margin: 0 0 12px; font-size: 0.92rem; background: #101010;
    border: 1px solid var(--bot-border); border-radius: 10px; box-shadow: none; text-align: left;
}

.bot-stuff .sub-panel {
    width: 100%; margin: 12px 0 0; padding: 14px; display: flex; flex-direction: column;
    align-items: stretch; gap: 12px; background: #1a1a1a;
    border: 1px solid #3b3b3b; border-radius: 12px; box-shadow: none;
}
.bot-stuff .toggle-switches.sub-panel { display: grid; }

.bot-stuff .sub-panel > button.collapsible-panel {
    width: 100%; max-width: none; min-width: 0; min-height: 48px; padding: 10px 42px 10px 12px;
    position: relative; justify-content: flex-start; color: var(--bot-text); background: #242424;
    border: 1px solid #414141; border-radius: 10px; box-shadow: none; text-align: left; white-space: normal;
}
.bot-stuff .sub-panel > button.collapsible-panel::after {
    content: "−"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
}
.bot-stuff .sub-panel > button.collapsible-panel.collapsed::after { content: "+"; }

.bot-stuff .sub-panel > div.collapsible-panel {
    width: 100%; max-width: none; min-width: 0; padding: 14px; display: block;
    color: var(--bot-text); background: #151515; border: 1px solid #363636;
    border-radius: 10px; box-shadow: none; white-space: normal;
}
.bot-stuff .sub-panel > div.collapsible-panel.panel-hidden { display: none !important; }

.bot-stuff .toggle-panel > label,
.bot-stuff .sub-panel > label,
.bot-stuff div.collapsible-panel:not(button) > label {
    width: 100%; margin: 0 0 12px; display: grid;
    grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
}

.bot-stuff .gpt-prompts-input, .bot-stuff .chat-alerts-input,
.bot-stuff .add-eight-ball-response-input, .bot-stuff .moderation-input {
    width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; font-family: inherit;
    font-size: 0.92rem; color: var(--bot-text); background: #101010;
    border: 1px solid var(--bot-border); border-radius: 10px; box-shadow: none;
    cursor: text; text-align: left; white-space: normal;
}
.bot-stuff #add-gpt-prompts-title-input, .bot-stuff #add-gpt-prompts-input { grid-column: 1 / -1; }

.bot-stuff .response-panel {
    width: 100%; margin: 0; padding: 12px; display: grid;
    grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center;
    background: #222; border: 1px solid #414141; border-radius: 10px; box-shadow: none;
}
.bot-stuff .response-panel h4, .bot-stuff .response-panel h6 { margin: 0; line-height: 1.45; }
.bot-stuff .response-panel h6 { grid-column: 1 / -1; color: var(--bot-muted); font-size: 0.78rem; font-weight: 400; }
.bot-stuff .showing-new-window-button { width: 100%; margin-top: 2px; }

.bot-stuff .bot-controls-div-top {
    position: fixed; top: 50%; left: 50%; width: min(760px, calc(100vw - 32px));
    max-height: min(82vh, 900px); padding: 22px; transform: translate(-50%, -50%);
    overflow-y: auto; z-index: 9999; color: var(--bot-text); background: #151515;
    border: 1px solid #686868; border-radius: 16px;
    box-shadow: 0 30px 100px rgba(0,0,0,.75); text-align: left;
}
#close-config-window {
    float: none !important; position: sticky; top: 0; z-index: 2; margin-left: auto; display: block;
    min-width: 42px; width: 42px; height: 42px; padding: 0; border-radius: 999px;
}
#config-window h2 { margin-top: 4px; }
#config-window ul { list-style: none; margin: 14px 0; padding: 0; }
#config-window li, #config-window > div > div > div {
    margin-bottom: 12px; padding: 12px; background: #202020;
    border: 1px solid #3c3c3c; border-radius: 10px;
}
#config-window form { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #3b3b3b; }
#config-window form label { display: grid; gap: 6px; }

@media screen and (max-width: 900px) {
    .bot-dashboard-header { grid-template-columns: 1fr; align-items: stretch; }
    .bot-controls-sub-div { grid-template-columns: 1fr; }
    .bot-controls-div.is-open { grid-column: auto; }
}

@media screen and (max-width: 560px) {
    .bot-stuff { width: min(100% - 20px, 1400px); margin-top: 18px; font-size: 15px; }
    .bot-dashboard-header { padding: 16px; border-radius: 14px; }
    .bot-dashboard-buttons { grid-template-columns: 1fr; }
    .bot-controls-div > button.collapsible-panel { min-height: 72px; padding-left: 14px; }
    .bot-controls-div > .toggle-panel { padding: 12px; }
    .bot-stuff .toggle-panel > label, .bot-stuff .sub-panel > label,
    .bot-stuff div.collapsible-panel:not(button) > label, .bot-stuff .response-panel { grid-template-columns: 1fr; }
    .bot-stuff input[type="submit"], .bot-stuff input[type="reset"], .bot-stuff .response-panel-button { width: 100%; }
    .bot-stuff .toggle-switches { padding: 12px; }
    .bot-stuff .bot-controls-div-top { width: calc(100vw - 20px); max-height: calc(100vh - 20px); padding: 14px; }
}

/* ==========================================================================
   Dashboard polish pass
   Fixes switch sizing, range controls, and nested alert accordions.
   ========================================================================== */

/* Own the switch geometry here so rules from switches.css cannot stretch or
   collapse switches inside the settings dashboard. */
.bot-stuff label.switch {
    position: relative !important;
    display: inline-block !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 30px !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 52px !important;
    justify-self: end;
    overflow: visible;
    vertical-align: middle;
}

.bot-stuff label.switch > input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    pointer-events: none;
}

.bot-stuff label.switch > .slider {
    position: absolute !important;
    inset: 0 !important;
    width: 52px !important;
    height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #303030 !important;
    border: 1px solid #555 !important;
    border-radius: 999px !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45) !important;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease !important;
}

.bot-stuff label.switch > .slider::before {
    content: "" !important;
    position: absolute !important;
    left: 3px !important;
    top: 3px !important;
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    background: #d2d2d2 !important;
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55) !important;
    transform: translateX(0) !important;
    transition: transform 0.16s ease, background-color 0.16s ease !important;
}

.bot-stuff label.switch > input[type="checkbox"]:checked + .slider {
    background: #286a49 !important;
    border-color: #438864 !important;
}

.bot-stuff label.switch > input[type="checkbox"]:checked + .slider::before {
    transform: translateX(22px) !important;
    background: #ffffff !important;
}

.bot-stuff label.switch > input[type="checkbox"]:disabled + .slider {
    opacity: 0.45;
    cursor: not-allowed;
}

.bot-stuff label.switch > input[type="checkbox"]:focus-visible + .slider {
    outline: 3px solid var(--bot-focus);
    outline-offset: 3px;
}

/* Nested setting blocks that have a heading and a direct switch, such as the
   GPT 8-ball controls, should use the same label-left/switch-right row. */
.bot-stuff .sub-panel.switch-row-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 14px;
}

.bot-stuff .sub-panel.switch-row-panel > h6 {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
}

.bot-stuff .sub-panel.switch-row-panel > .range-div,
.bot-stuff .sub-panel.switch-row-panel > label:not(.switch),
.bot-stuff .sub-panel.switch-row-panel > .response-panel {
    grid-column: 1 / -1;
}

/* Range controls now match the dashboard instead of falling back to the
   browser's bright native slider. */
.bot-stuff input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.bot-stuff input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: #343434;
    border: 1px solid #505050;
    border-radius: 999px;
}

.bot-stuff input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -7px;
    background: #f1f1f1;
    border: 2px solid #707070;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.bot-stuff input[type="range"]::-moz-range-track {
    height: 6px;
    background: #343434;
    border: 1px solid #505050;
    border-radius: 999px;
}

.bot-stuff input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #f1f1f1;
    border: 2px solid #707070;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

/* Top-level panels containing another accordion (Chat Alerts) become a compact
   two-column list when closed. An opened item expands across the full width. */
.bot-controls-div > .toggle-panel.has-nested-accordions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.bot-controls-div > .toggle-panel.has-nested-accordions > .toggle-switches,
.bot-controls-div > .toggle-panel.has-nested-accordions > .blank-space-above-and-below-toggles,
.bot-controls-div > .toggle-panel.has-nested-accordions > .permissions-selection-label,
.bot-controls-div > .toggle-panel.has-nested-accordions > .permissions-selection,
.bot-controls-div > .toggle-panel.has-nested-accordions > .showing-new-window-button {
    grid-column: 1 / -1;
}

.bot-controls-div > .toggle-panel.has-nested-accordions > br {
    display: none;
}

.bot-controls-div > .toggle-panel > button.collapsible-panel {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 52px;
    margin: 0;
    padding: 11px 46px 11px 14px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    color: var(--bot-text);
    background: #202020;
    border: 1px solid #414141;
    border-radius: 11px;
    box-shadow: none;
    text-align: left;
    white-space: normal;
}

.bot-controls-div > .toggle-panel > button.collapsible-panel:hover {
    background: #292929;
    border-color: #626262;
}

.bot-controls-div > .toggle-panel > button.collapsible-panel .collapsible-panel-button-text {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
}

.bot-controls-div > .toggle-panel > button.collapsible-panel::after {
    content: "−";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    color: var(--bot-muted);
    border: 1px solid #4b4b4b;
    border-radius: 50%;
    font-size: 0.95rem;
    line-height: 1;
}

.bot-controls-div > .toggle-panel > button.collapsible-panel.collapsed::after {
    content: "+";
}

.bot-controls-div > .toggle-panel.has-nested-accordions > button.collapsible-panel.is-open,
.bot-controls-div > .toggle-panel.has-nested-accordions > .toggle-panel {
    grid-column: 1 / -1;
}

.bot-controls-div > .toggle-panel > button.collapsible-panel + .toggle-panel {
    margin: 0;
    padding: 14px;
    background: #191919;
    border: 1px solid #3e3e3e;
    border-radius: 11px;
}

.bot-controls-div > .toggle-panel > button.collapsible-panel + .toggle-panel > br {
    display: none;
}

.bot-controls-div > .toggle-panel > button.collapsible-panel + .toggle-panel > .toggle-switches:last-child,
.bot-controls-div > .toggle-panel > button.collapsible-panel + .toggle-panel > label:last-child {
    margin-bottom: 0;
}

/* Keep rows neat when a label contains text and a switch. */
.bot-stuff .toggle-switches > label.switch {
    align-self: center;
}

@media screen and (max-width: 700px) {
    .bot-controls-div > .toggle-panel.has-nested-accordions {
        grid-template-columns: 1fr;
    }

    .bot-controls-div > .toggle-panel.has-nested-accordions > button.collapsible-panel,
    .bot-controls-div > .toggle-panel.has-nested-accordions > .toggle-panel {
        grid-column: 1;
    }
}

/* -------------------------------------------------------------------------
   Moderation protection accordions
   Uses the same visual/card treatment as Chat Alerts: two compact cards per
   row while closed, with the opened protection expanding across both columns.
   ------------------------------------------------------------------------- */
.bot-controls-div > .toggle-panel.moderation-nested-accordions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

/* Keep the master Moderation toggle above the protection-card grid. */
.bot-controls-div > .toggle-panel.moderation-nested-accordions > .toggle-switches,
.bot-controls-div > .toggle-panel.moderation-nested-accordions > .blank-space-above-and-below-toggles {
    grid-column: 1 / -1;
}

.bot-controls-div > .toggle-panel.moderation-nested-accordions > br {
    display: none;
}

/* The old .sub-panel shell should disappear so each protection looks exactly
   like a Chat Alerts card instead of a card nested inside another card. */
.bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: block;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item.is-open {
    grid-column: 1 / -1;
}

/* Closed protection card header — same dimensions and treatment as Chat Alerts. */
.bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item > button.collapsible-panel {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 64px;
    margin: 0;
    padding: 14px 52px 14px 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    color: var(--bot-text);
    background: #202020;
    border: 1px solid #414141;
    border-radius: 12px;
    box-shadow: none;
    text-align: left;
    white-space: normal;
}

.bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item > button.collapsible-panel:hover {
    background: #292929;
    border-color: #626262;
    transform: none;
}

.bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item > button.collapsible-panel .collapsible-panel-button-text {
    margin: 0;
    color: var(--bot-text);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
}

.bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item > button.collapsible-panel::after {
    content: "−";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: var(--bot-muted);
    border: 1px solid #4b4b4b;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
}

.bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item > button.collapsible-panel.collapsed::after {
    content: "+";
}

/* Expanded protection body. */
.bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item > div.collapsible-panel {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 10px 0 0;
    padding: 16px;
    display: block;
    color: var(--bot-text);
    background: #191919;
    border: 1px solid #3e3e3e;
    border-radius: 12px;
    box-shadow: none;
    white-space: normal;
}

.bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item > div.collapsible-panel.panel-hidden {
    display: none !important;
}

@media screen and (max-width: 700px) {
    .bot-controls-div > .toggle-panel.moderation-nested-accordions {
        grid-template-columns: 1fr;
    }

    .bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item,
    .bot-controls-div > .toggle-panel.moderation-nested-accordions > .moderation-accordion-item.is-open {
        grid-column: 1;
    }
}

/* ========================================================================== */
/* Extended JSON-backed NioBot editors                                       */
/* ========================================================================== */

.bot-stuff .field-help {
    width: 100%;
    margin: 8px 0;
    color: var(--bot-muted, #bdbdbd);
    font-size: .78rem;
    line-height: 1.45;
    text-align: left;
}

.bot-stuff .settings-add-grid,
.bot-stuff .word-protection-add-grid {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.bot-stuff .settings-add-grid textarea,
.bot-stuff .settings-add-grid > input:first-child,
.bot-stuff .word-protection-add-grid > input:first-child {
    grid-column: 1 / -1;
}

.bot-stuff .gpt-prompts-input,
.bot-stuff .add-eight-ball-response-input,
.bot-stuff .dynamic-title-input,
.bot-stuff .dynamic-body-input,
.bot-stuff .timer-dynamic-leaf input,
.bot-stuff .timed-message-editor-row input,
.bot-stuff .timed-message-editor-row textarea,
.bot-stuff .timed-message-editor-row select,
.bot-stuff .timed-message-add-form input,
.bot-stuff .timed-message-add-form textarea,
.bot-stuff .timed-message-add-form select {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    color: var(--bot-text, #f5f5f5);
    background: #101010;
    border: 1px solid var(--bot-border, #4a4a4a);
    border-radius: 9px;
    font: inherit;
    font-size: .82rem;
    box-shadow: none;
    text-align: left;
}

.bot-stuff textarea.gpt-prompts-input,
.bot-stuff textarea.dynamic-body-input,
.bot-stuff .timed-message-editor-row textarea,
.bot-stuff .timed-message-add-form textarea {
    min-height: 86px;
    resize: vertical;
    white-space: normal;
}

.bot-stuff .dynamic-settings-list {
    width: 100%;
    display: grid;
    gap: 9px;
}

.bot-stuff .dynamic-response-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

.bot-stuff .dynamic-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

.bot-stuff .dynamic-row-actions button,
.bot-stuff .settings-add-grid button,
.bot-stuff .word-protection-add-grid button,
.bot-stuff .timer-runtime-editor button,
.bot-stuff .timed-message-editor-row button,
.bot-stuff .timed-message-add-form button {
    min-width: 0;
    padding: 8px 11px;
    font-size: .78rem;
    border-width: 1px;
    border-radius: 9px;
    box-shadow: none;
    transform: none !important;
}

.bot-stuff .word-protection-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(160px, 1.5fr) minmax(120px, .8fr) minmax(100px, .6fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    background: #202020;
    border: 1px solid #414141;
    border-radius: 10px;
}

.bot-stuff .word-protection-row .moderation-input,
.bot-stuff .word-protection-row .permissions-selection {
    width: 100%;
    margin: 0;
}

.bot-stuff .moderation-enforcement-row {
    width: 100%;
    margin: 10px 0;
    display: grid;
    gap: 6px;
    text-align: left;
}

.bot-stuff .timer-runtime-editor,
.bot-stuff .timed-message-list,
.bot-stuff .timed-message-add-form {
    display: grid;
    gap: 10px;
}

.bot-stuff .timer-module-group,
.bot-stuff .timer-dynamic-group,
.bot-stuff .timed-message-editor-row,
.bot-stuff .timed-message-add-form {
    padding: 12px;
    background: #202020;
    border: 1px solid #414141;
    border-radius: 10px;
}

.bot-stuff .timer-module-group h4,
.bot-stuff .timed-message-editor-row h4,
.bot-stuff .timed-message-add-form h4 {
    margin: 0 0 8px;
}

.bot-stuff .timer-dynamic-field {
    display: grid;
    gap: 8px;
}

.bot-stuff .timer-dynamic-group {
    display: grid;
    gap: 7px;
}

.bot-stuff .timer-dynamic-leaf,
.bot-stuff .timed-message-editor-row > label,
.bot-stuff .timed-message-add-form > label {
    display: grid;
    gap: 5px;
    color: var(--bot-muted, #bdbdbd);
    font-size: .78rem;
    text-align: left;
}

.bot-stuff .timed-message-check {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center;
}

.bot-stuff .timed-message-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
}

#niobot-save-status {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10050;
    max-width: min(440px, calc(100vw - 36px));
    padding: 10px 13px;
    color: #f5f5f5;
    background: #173023;
    border: 1px solid #3f7955;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
    font-size: .82rem;
    text-align: left;
}

#niobot-save-status[data-kind="error"] {
    background: #371a1a;
    border-color: #824343;
}

@media screen and (max-width: 760px) {
    .bot-stuff .settings-add-grid,
    .bot-stuff .word-protection-add-grid,
    .bot-stuff .word-protection-row {
        grid-template-columns: 1fr;
    }

    .bot-stuff .settings-add-grid > *,
    .bot-stuff .word-protection-add-grid > * {
        grid-column: 1;
    }

    .bot-stuff .dynamic-row-actions {
        justify-content: stretch;
    }

    .bot-stuff .dynamic-row-actions button {
        flex: 1 1 120px;
    }
}

/* Quote, shoutout, and counter overlay editors */
#config-window .dynamic-list,
#config-window .quote-editor,
#config-window .shoutout-editor,
#config-window .counter-editor {
    display: grid;
    gap: 12px;
}

#config-window .dynamic-editor-row,
#config-window .quote-editor-row,
#config-window .counter-editor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: center;
    padding: 12px;
    background: #202020;
    border: 1px solid #414141;
    border-radius: 10px;
}

#config-window .dynamic-editor-copy,
#config-window .quote-editor-heading {
    min-width: 0;
    display: grid;
    gap: 3px;
}

#config-window .dynamic-editor-copy small,
#config-window .quote-editor-heading small {
    color: var(--bot-muted, #bdbdbd);
    overflow-wrap: anywhere;
}

#config-window .quote-editor-row textarea,
#config-window .counter-editor-row textarea,
#config-window .counter-editor-row input,
#config-window .dynamic-add-form input,
#config-window .dynamic-add-form textarea,
#config-window .dynamic-add-form select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 9px 10px;
    color: var(--bot-text, #f5f5f5);
    background: #101010;
    border: 1px solid var(--bot-border, #4a4a4a);
    border-radius: 8px;
    font: inherit;
}

#config-window .quote-editor-row textarea,
#config-window .counter-editor-row textarea,
#config-window .dynamic-add-form textarea {
    min-height: 84px;
    resize: vertical;
}

#config-window .quote-editor-row > textarea,
#config-window .counter-editor-row > input,
#config-window .counter-editor-row > textarea {
    grid-column: 1 / -1;
}

#config-window .dynamic-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

#config-window .quote-editor-row .dynamic-row-actions,
#config-window .counter-editor-row .dynamic-row-actions {
    grid-column: 1 / -1;
}

#config-window .dynamic-add-form {
    margin-top: 16px;
    padding-top: 16px;
    display: grid;
    gap: 10px;
    border-top: 1px solid #3b3b3b;
}

#config-window .dynamic-add-form label {
    display: grid;
    gap: 6px;
}

@media (max-width: 620px) {
    #config-window .dynamic-editor-row,
    #config-window .quote-editor-row,
    #config-window .counter-editor-row {
        grid-template-columns: 1fr;
    }

    #config-window .dynamic-row-actions {
        justify-content: stretch;
    }

    #config-window .dynamic-row-actions button {
        flex: 1 1 auto;
    }
}

/* Friendly counter editor */
#config-window .counter-card-list {
    display: grid;
    gap: 14px;
}

#config-window .counter-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid #414141;
    border-radius: 12px;
    background: #202020;
}

#config-window .counter-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#config-window .counter-card-heading h4 {
    margin: 0 0 3px;
    color: var(--bot-text, #f5f5f5);
}

#config-window .counter-card-heading small,
#config-window .counter-alias-empty {
    color: var(--bot-muted, #bdbdbd);
}

#config-window .counter-fields {
    display: grid;
    grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

#config-window .counter-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

#config-window .counter-field > span:first-child {
    font-weight: 700;
}

#config-window .counter-field input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 9px 10px;
    color: var(--bot-text, #f5f5f5);
    background: #101010;
    border: 1px solid var(--bot-border, #4a4a4a);
    border-radius: 8px;
    font: inherit;
}

#config-window .counter-alias-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 32px;
    align-items: center;
}

#config-window .counter-alias-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 7px 5px 10px;
    border: 1px solid #575757;
    border-radius: 999px;
    background: #161616;
}

#config-window .counter-alias-remove {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    line-height: 1;
}

#config-window .counter-alias-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 8px;
}

#config-window .counter-card-actions {
    justify-content: flex-start;
}

#config-window .counter-reset-button,
#config-window .counter-delete-button {
    border-color: #6a4b4b;
}

#config-window .counter-add-form {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid #414141;
    border-radius: 12px;
    background: #1b1b1b;
}

#config-window .counter-add-form h4 {
    margin: 0;
}

@media (max-width: 680px) {
    #config-window .counter-fields,
    #config-window .counter-alias-add-row {
        grid-template-columns: 1fr;
    }

    #config-window .counter-card-actions button {
        flex: 1 1 120px;
    }
}
