:root {
    color-scheme:dark;
    --bg:#040f1a;
    --panel:#081e2d;
    --line:#224b60;
    --text:#edf7fc;
    --muted:#a2bac9;
    --cyan:#00d2ed;
    --red:#ed4245
}
* {
    box-sizing:border-box
}
html,body {
    height:100%;
    margin:0;
    overflow:hidden
}
body {
    background:radial-gradient(ellipse at 50% 0,#103248,var(--bg) 70%);
    color:var(--text);
    font:14px "Segoe UI",Arial,sans-serif
}
button,input,select,textarea {
    font:inherit
}
button,a,input,select,textarea {
    touch-action:manipulation
}
a {
    color:var(--cyan);
    text-decoration:none
}
a:hover {
    text-decoration:underline
}
button {
    cursor:pointer
}
button:disabled {
    opacity:.45;
    cursor:wait
}
input:disabled,select:disabled,textarea:disabled {
    opacity:.7
}
[hidden] {
    display:none!important
}
:focus-visible {
    outline:2px solid var(--cyan);
    outline-offset:3px
}
.topbar {
    height:52px;
    padding:0 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    border-bottom:1px solid var(--line);
    background:#05131f
}
.brand {
    font-size:15px;
    letter-spacing:1.3px;
    font-weight:800;
    color:var(--text)
}
.brand>span:first-child {
    color:var(--cyan)
}
.brand-divider {
    color:#698e9f;
    margin:0 8px
}
.back-link {
    font-size:16px;
    padding:8px 12px;
    border:1px solid var(--line);
    border-radius:8px
}
.shell {
    max-width:1480px;
    height:calc(100dvh - 52px);
    margin:auto;
    padding:16px 22px;
    display:flex;
    flex-direction:column;
    gap:14px;
    min-height:0
}
.page-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    flex-shrink:0
}
.eyebrow {
    color:#83aabf;
    font-size:14px;
    font-weight:800;
    letter-spacing:1.7px;
    margin-bottom:4px
}
h1 {
    font-size:31.5px;
    margin:0;
    line-height:1.2
}
h1>span {
    font-size:28.1px;
    margin-right:6px
}
.heading-copy>p {
    margin:6px 0 0;
    font-size:16.5px;
    color:var(--muted)
}
.server-state {
    display:flex;
    align-items:flex-end;
    flex-direction:column;
    gap:7px;
    font-size:16px;
    color:var(--muted);
    max-width:40%;
    text-align:right
}
.badge {
    padding:6px 10px;
    border:1px solid #52606b;
    border-radius:20px;
    font-size:15px;
    font-weight:700;
    color:#d0dce6;
    background:#152937
}
.badge.active {
    color:#70edb5;
    border-color:#276c52;
    background:#0b3127
}
.badge.offline {
    color:#ffd385;
    border-color:#836530;
    background:#33270e
}
.workspace {
    flex:1;
    min-height:0;
    display:flex;
    flex-direction:column;
    border:1px solid var(--line);
    border-radius:13px;
    background:linear-gradient(140deg,#0a2536,#061a28);
    overflow:hidden
}
.workspace-header {
    padding:10px 16px;
    border-bottom:1px solid var(--line);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    flex-shrink:0
}
.tabs {
    display:flex;
    gap:6px
}
.tabs>button {
    min-height:40px;
    border:1px solid transparent;
    border-radius:8px;
    padding:8px 22px;
    background:transparent;
    color:#b9d4e4;
    font-weight:700
}
.tabs>button[aria-selected=true] {
    background:#123c50;
    border-color:#26738d;
    color:#fff
}
.tabs>button:hover {
    background:#103248
}
.channel-state {
    display:flex;
    align-items:center;
    gap:14px;
    font-size:16px;
    min-width:0
}
.channel-state>span {
    color:#d7eaf5;
    font-weight:700;
    overflow-wrap:anywhere
}
.view {
    flex:1;
    min-height:0;
    padding:20px
}
.warning-layout {
    display:grid;
    grid-template-columns:minmax(0,1.25fr) minmax(280px,1fr);
    gap:24px
}
.warning-editor {
    display:grid;
    grid-template-rows:auto minmax(130px,1fr) auto;
    gap:16px;
    min-height:0;
    min-width:0
}
.field {
    display:flex;
    flex-direction:column;
    gap:7px;
    min-height:0;
    min-width:0;
    font-size:16px;
    font-weight:700;
    color:#cee4ee
}
input:not([type=checkbox]),textarea,select {
    width:100%;
    min-width:0;
    border:1px solid #2c596e;
    border-radius:8px;
    background:#041725;
    color:#edf7fc;
    padding:10px 12px;
    font-size:16.5px;
    outline:none
}
input:focus,textarea:focus,select:focus {
    border-color:var(--cyan)
}
textarea {
    resize:none;
    line-height:1.65;
    min-height:0
}
.description-field>textarea {
    flex:1;
    height:100%
}
.editor-bottom {
    display:grid;
    grid-template-columns:minmax(0,1fr) 68px;
    gap:14px
}
input[type=color] {
    height:38px;
    padding:4px;
    cursor:pointer
}
.preview-panel {
    padding:18px;
    background:#081725;
    border:1px solid #244655;
    border-radius:10px;
    display:flex;
    flex-direction:column;
    min-height:0;
    min-width:0
}
.preview-label {
    display:flex;
    justify-content:space-between;
    gap:12px;
    font-size:14px;
    letter-spacing:1px;
    color:#93b2c3
}
.preview-label>span {
    font-size:14px;
    letter-spacing:0;
    color:#829baa
}
.discord-author {
    display:flex;
    align-items:center;
    gap:9px;
    margin:20px 0 12px;
    font-size:16.5px
}
.bot-avatar {
    width:32px;
    height:32px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#123649
}
.app-badge {
    font-size:13px;
    background:#5865f2;
    color:white;
    border-radius:3px;
    padding:2px 4px
}
.discord-embed {
    margin-left:41px;
    padding:16px;
    border-left:4px solid var(--red);
    border-radius:4px;
    background:#16222e;
    overflow:auto;
    min-height:0;
    overflow-wrap:anywhere
}
.discord-embed h2 {
    font-size:17.5px;
    line-height:1.5;
    margin:0 0 12px
}
.discord-embed>div {
    font-size:16.5px;
    line-height:1.65;
    white-space:pre-wrap
}
.discord-embed>p {
    font-size:14px;
    line-height:1.5;
    color:#aebbc6;
    margin:16px 0 0
}
.preview-note {
    color:#8da8b9;
    font-size:15px;
    line-height:1.5;
    margin:16px 0 0 41px
}
.preview-note>strong {
    color:#b9cddd
}
.protection-layout {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:22px;
    overflow:auto
}
.settings-card {
    min-width:0;
    border:1px solid #244b60;
    border-radius:10px;
    padding:18px;
    display:flex;
    flex-direction:column;
    gap:14px;
    align-self:start
}
.settings-card h2,.activity-heading h2 {
    font-size:19.6px;
    margin:0
}
.settings-card>p,.activity-heading p {
    font-size:16px;
    line-height:1.6;
    color:var(--muted);
    margin:-6px 0 0
}
.two-columns {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px
}
.logging-heading {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px
}
.logging-heading h3 {
    font-size:17.5px;
    margin:0
}
.checkbox {
    display:flex;
    align-items:center;
    gap:9px;
    min-height:28px;
    font-size:16px;
    color:#d6e8f2;
    cursor:pointer
}
.checkbox input {
    width:17px;
    height:17px;
    accent-color:var(--cyan);
    flex-shrink:0
}
.exemptions {
    display:flex;
    gap:20px;
    flex-wrap:wrap
}
.field-hint {
    font-size:15px!important;
    color:#8fabbc!important;
    line-height:1.5
}
.action-summary {
    border-left:3px solid var(--red);
    background:#14252f;
    border-radius:5px;
    padding:10px 12px;
    font-size:16px;
    display:flex;
    flex-direction:column;
    gap:5px
}
.action-summary>span {
    line-height:1.5;
    color:#aec5d3
}
#trapWarningMessage {
    min-height:75px
}
#exemptRoles {
    min-height:80px
}
.activity-view {
    overflow:auto
}
.activity-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px
}
.activity-heading p {
    margin:6px 0 0
}
#eventsStatus {
    color:var(--muted);
    font-size:16.5px
}
.event-list {
    display:flex;
    flex-direction:column;
    gap:10px
}
.event-row {
    padding:14px;
    border:1px solid #275066;
    border-radius:9px;
    display:grid;
    grid-template-columns:1fr auto;
    gap:6px 12px;
    background:#082132;
    overflow-wrap:anywhere
}
.event-row h3 {
    margin:0;
    font-size:16.5px
}
.event-row p,.event-row time {
    color:var(--muted);
    font-size:16px;
    margin:0;
    line-height:1.5
}
.event-row .event-note {
    grid-column:1/-1;
    color:#f6ce83
}
.event-row .event-error {
    grid-column:1/-1;
    color:#ff989a
}
.controls {
    flex-shrink:0;
    display:flex;
    flex-direction:column;
    gap:9px
}
.control-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px
}
.enable-control {
    font-size:16.5px;
    font-weight:700
}
.enable-control small {
    display:block;
    color:var(--muted);
    font-size:15px;
    font-weight:400;
    line-height:1.5;
    margin-top:3px
}
.command-buttons {
    display:flex;
    gap:9px
}
.button {
    min-height:42px;
    padding:9px 18px;
    border:1px solid #2d6177;
    border-radius:8px;
    font-size:16px;
    font-weight:700;
    color:white;
    background:#12394e
}
.button:hover:not(:disabled) {
    filter:brightness(1.15)
}
.primary {
    background:#007e9f;
    border-color:#00badf
}
.secondary {
    background:#0d2c3e
}
.feedback-row {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    min-height:20px;
    font-size:15px
}
.feedback-row p {
    margin:0;
    color:#9db7c8;
    line-height:1.6;
    overflow-wrap:anywhere
}
.feedback-row p.error {
    color:#ff9a9d
}
.feedback-row p.success {
    color:#75e7b3
}
.feedback-row a {
    white-space:nowrap;
    padding-top:2px
}
@media(min-width:761px) and (max-height:780px) {
    .shell {
        padding:12px 18px;
        gap:10px
    }
    .eyebrow {
        display:none
    }
    h1 {
        font-size:28.1px
    }
    .page-heading p {
        font-size:16px;
        margin-top:4px
    }
    .view {
        padding:14px
    }
    .workspace-header {
        padding:7px 14px
    }
    .warning-editor {
        gap:12px
    }
    .preview-panel {
        padding:14px
    }
    .discord-author {
        margin-top:12px
    }
    .settings-card {
        padding:14px;
        gap:11px
    }
    .settings-card>p {
        font-size:15px
    }
    .exemptions {
        gap:10px
    }
    .action-summary {
        font-size:15px
    }
    .controls {
        gap:6px
    }
}
@media(max-width:1000px) {
    .warning-layout {
        grid-template-columns:minmax(0,1.2fr) minmax(260px,1fr);
        gap:16px
    }
    .discord-embed {
        margin-left:0
    }
    .preview-note {
        margin-left:0
    }
    .preview-label>span {
        display:none
    }
    .tabs>button {
        padding:8px 16px
    }
}
@media(max-width:760px) {
    html,body {
        height:auto;
        min-height:100%;
        overflow:visible
    }
    body {
        min-height:100dvh
    }
    .topbar {
        padding:0 14px;
        height:54px;
        gap:10px
    }
    .brand {
        font-size:13px;
        letter-spacing:.5px
    }
    .brand-divider {
        margin:0 4px
    }
    .back-link {
        font-size:14px;
        padding:10px 8px;
        white-space:nowrap
    }
    .shell {
        height:auto;
        min-height:calc(100dvh - 54px);
        padding:18px 12px 22px;
        gap:16px
    }
    .page-heading {
        align-items:flex-start;
        gap:12px
    }
    .eyebrow {
        font-size:13px
    }
    h1 {
        font-size:29.3px
    }
    .heading-copy>p {
        font-size:16px;
        line-height:1.5;
        max-width:30ch
    }
    .server-state {
        font-size:14px;
        max-width:38%;
        padding-top:3px
    }
    .workspace-header {
        padding:10px;
        flex-direction:column;
        align-items:stretch;
        gap:12px
    }
    .tabs {
        display:grid;
        grid-template-columns:repeat(3,minmax(0,1fr));
        gap:4px
    }
    .tabs>button {
        padding:8px;
        min-height:44px;
        font-size:16px
    }
    .channel-state {
        justify-content:space-between;
        font-size:15px
    }
    .warning-layout,.protection-layout {
        grid-template-columns:minmax(0,1fr);
        gap:18px;
        padding:14px
    }
    .warning-editor {
        grid-template-rows:auto auto auto;
        gap:14px
    }
    .description-field>textarea {
        height:210px;
        min-height:170px
    }
    .preview-panel {
        padding:14px
    }
    .discord-embed {
        overflow:visible
    }
    .preview-label>span {
        display:block
    }
    .preview-note {
        margin-top:12px
    }
    .settings-card {
        padding:14px
    }
    .exemptions {
        gap:12px
    }
    .controls {
        gap:12px;
        padding:0 2px
    }
    .control-row {
        flex-direction:column;
        align-items:stretch;
        gap:14px
    }
    .enable-control {
        min-height:44px
    }
    .command-buttons {
        display:grid;
        grid-template-columns:1fr 1.2fr;
        gap:8px
    }
    .button {
        min-height:46px;
        padding:10px 12px
    }
    .feedback-row {
        flex-direction:column;
        gap:7px;
        font-size:15px
    }
    .activity-view {
        padding:14px
    }
    .event-row {
        grid-template-columns:1fr
    }
    .event-row time {
        font-size:14px
    }
    .feedback-row a {
        min-height:30px
    }
    .logging-heading {
        align-items:flex-start
    }
    .settings-card select[multiple] {
        min-height:110px
    }
}
/* Keep entered text lighter than field labels, and long server names contained. */
input:not([type=checkbox]),textarea,select {
    font-weight:400
}
.heading-copy {
    min-width:0
}
#serverName {
    overflow-wrap:anywhere
}
@media(max-width:760px) {
    .description-field>textarea {
        flex:none;
        min-height:210px
    }
}
.setup-layout {display:grid;grid-template-columns:1fr 1fr;gap:18px;align-content:center;overflow:auto}
.setup-card {display:flex;flex-direction:column;align-self:stretch;gap:16px;border:1px solid #2c566c;border-radius:12px;background:#092333;padding:24px;min-width:0}
.setup-kicker {color:#80b7ce;font-size:14px;font-weight:800;letter-spacing:1.5px}
.setup-card h2 {margin:0;font-size:24.7px}
.setup-card p,.setup-card li,.setup-explanation {margin:0;color:var(--muted);font-size:16.5px;line-height:1.65}
.setup-card .setup-note {font-size:16px}
.setup-card>button {margin-top:auto;align-self:stretch}
.setup-card ul {padding-left:20px;margin:0 0 4px}
.setup-card li+li {margin-top:5px}
.auto-card {border-color:#7e3c47;background:linear-gradient(130deg,#29202b,#0b2331)}
.auto-card .setup-kicker {color:#ff999e}
.auto-channel {font-size:21.3px;font-weight:800;color:#ffb2b5;background:#381c28;border:1px solid #7d3c4b;border-radius:8px;padding:12px 16px}
.setup-explanation {grid-column:1/-1;font-size:16px;max-width:90ch}
@media(min-width:761px) and (max-height:780px) {.setup-card{padding:18px;gap:12px}.setup-card h2{font-size:22.5px}.setup-card p,.setup-card li{font-size:16px}.auto-channel{padding:10px 14px}}
@media(max-width:760px) {.tabs{grid-template-columns:repeat(4,minmax(0,1fr))}.tabs>button{font-size:15px;padding:8px 4px}.setup-layout{grid-template-columns:minmax(0,1fr);padding:14px;gap:16px}.setup-card{padding:18px;gap:14px}.setup-card h2{font-size:23.6px}.setup-card>button{min-height:46px}.setup-explanation{font-size:15px}}
.role-picker {position:relative;font-weight:400}
.role-picker>summary {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px;padding:10px 12px;border:1px solid #2c596e;border-radius:8px;background:#041725;color:#edf7fc;cursor:pointer;font-size:16.5px;list-style:none}
.role-picker>summary::-webkit-details-marker {display:none}
.role-picker[open]>summary {border-color:var(--cyan)}
.role-chevron {font-size:20.7px;line-height:1;flex-shrink:0;color:#85bed3}
.role-picker[open] .role-chevron {transform:rotate(180deg)}
.role-menu {margin-top:7px;border:1px solid #2b6178;border-radius:9px;background:#061c2b;padding:8px;box-shadow:0 10px 24px #0004}
.role-menu-heading {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:3px 6px 8px;font-size:15px;color:var(--muted)}
.role-menu-heading button {border:0;background:none;color:var(--cyan);font-size:15px;cursor:pointer;padding:6px}
#roleOptions {max-height:200px;overflow-y:auto;overscroll-behavior:contain}
.role-option {display:flex;align-items:center;gap:10px;min-height:40px;padding:9px 8px;border-radius:6px;font-size:16.5px;line-height:1.4;color:#dfedf5;cursor:pointer;overflow-wrap:anywhere}
.role-option:hover {background:#12394b}
.role-option:has(input:checked) {background:#0f3447}
.role-option input {width:17px;height:17px;margin:0;accent-color:var(--cyan);flex-shrink:0}
.role-empty {font-size:16px;color:var(--muted);padding:8px;margin:0}
@media(max-width:760px) {.role-picker>summary,.role-option {min-height:46px}.role-menu-heading button {min-height:40px}}
