@font-face {
    font-family: "UCRP Display";
    src: url("/assets/fonts/Motorblock.ttf") format("truetype");
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #000000;
    --surface: rgba(3, 7, 12, 0.94);
    --surface-soft: rgba(8, 17, 26, 0.92);
    --surface-raised: rgba(12, 24, 36, 0.96);
    --ink: #d9f8ff;
    --ink-strong: #f5fdff;
    --muted: #8bb6c2;
    --muted-light: #5f7f89;
    --line: rgba(140, 229, 255, 0.2);
    --line-strong: rgba(140, 229, 255, 0.34);
    --sidebar: #000000;
    --sidebar-raised: rgba(140, 229, 255, 0.1);
    --sidebar-ink: #f5fdff;
    --sidebar-muted: #8bb6c2;
    --primary: #8ce5ff;
    --primary-dark: #55ceef;
    --primary-soft: rgba(140, 229, 255, 0.15);
    --green: #8ce5ff;
    --green-soft: rgba(140, 229, 255, 0.15);
    --amber: #e8801f;
    --amber-soft: rgba(232, 128, 31, 0.18);
    --purple: #c900d6;
    --purple-soft: rgba(201, 0, 214, 0.18);
    --coral: #c900d6;
    --coral-soft: rgba(201, 0, 214, 0.18);
    --danger: #c900d6;
    --danger-dark: #9f00aa;
    --danger-soft: rgba(201, 0, 214, 0.2);
    --focus: #8ce5ff;
    --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-accent: "UCRP Display", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    --font-display: var(--font-body);
    --sidebar-width: 248px;
    --topbar-height: 64px;
    --shadow-sm: 0 0 18px rgba(140, 229, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 0 28px rgba(140, 229, 255, 0.14), 0 18px 60px rgba(0, 0, 0, 0.72);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    z-index: 0;
    inset: 0;
    background-image:
        linear-gradient(rgba(140, 229, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 0, 214, 0.045) 1px, transparent 1px),
        linear-gradient(135deg, transparent 0 46%, rgba(232, 128, 31, 0.045) 46% 47%, transparent 47% 100%);
    background-position: center top;
    background-size: 54px 54px, 54px 54px, 180px 180px;
    opacity: 0.62;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, transparent 0, #000 120px, #000 calc(100% - 80px), transparent 100%);
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

button,
a,
input,
select,
textarea,
summary {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

img {
    display: block;
}

.icon,
.nav-icon,
.button-icon,
.input-icon,
.select-icon,
.badge-icon,
.notice-icon,
.empty-icon,
.summary-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    filter: brightness(0) invert(1);
}

.sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    background:
        linear-gradient(180deg, rgba(140, 229, 255, 0.07), transparent 28%),
        var(--sidebar);
    color: var(--sidebar-ink);
    border-right: 1px solid rgba(140, 229, 255, 0.24);
    box-shadow: 0 0 28px rgba(140, 229, 255, 0.08);
}

.sidebar::after {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--purple), var(--amber));
    box-shadow: 0 0 18px rgba(140, 229, 255, 0.72);
}

.sidebar-top {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 4px 27px;
}

.brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 46px;
    height: 38px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.58);
    filter: drop-shadow(0 0 11px rgba(140, 229, 255, 0.38));
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy {
    min-width: 0;
    display: grid;
    line-height: 1.2;
}

.brand-copy strong {
    overflow: hidden;
    color: var(--sidebar-ink);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(140, 229, 255, 0.42);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy > span {
    margin-top: 4px;
    color: var(--amber);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}

.main-nav {
    display: grid;
    gap: 4px;
}

.nav-label {
    margin: 0 10px 6px;
    color: var(--purple);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.nav-label-spaced {
    margin-top: 21px;
}

.nav-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 11px;
    border-radius: 7px;
    color: #bdefff;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 740;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
}

.nav-link:hover {
    background: linear-gradient(90deg, rgba(140, 229, 255, 0.14), rgba(201, 0, 214, 0.08));
    color: #ffffff;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(140, 229, 255, 0.18), rgba(201, 0, 214, 0.12));
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--primary), 0 0 16px rgba(140, 229, 255, 0.1);
}

.nav-icon {
    width: 17px;
    height: 17px;
    opacity: 0.76;
    filter: brightness(0) invert(1);
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
    opacity: 1;
}

.user-block {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 14px 6px 0;
    border-top: 1px solid var(--line);
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--primary);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(140, 229, 255, 0.24), rgba(201, 0, 214, 0.14));
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(140, 229, 255, 0.22);
}

.user-copy {
    min-width: 0;
    display: grid;
    line-height: 1.25;
}

.user-copy strong,
.user-copy > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy strong {
    color: #f2f4f7;
    font-size: 12px;
}

.user-copy > span {
    margin-top: 3px;
    color: var(--sidebar-muted);
    font-size: 11px;
}

.user-block form {
    display: block;
}

.icon-button {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    box-shadow: none;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.icon-button img,
.logout-button img {
    width: 17px;
    height: 17px;
}

.sidebar-close {
    display: none;
}

.sidebar-close img,
.logout-button img {
    filter: brightness(0) invert(1);
    opacity: 0.76;
}

.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    padding: 0 32px;
    border-bottom: 1px solid rgba(140, 229, 255, 0.2);
    background: rgba(0, 0, 0, 0.84);
    backdrop-filter: blur(12px);
}

.menu-button {
    display: none;
}

.topbar-context,
.topbar-time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.topbar-context {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--green-soft);
}

.topbar-time {
    padding-left: 22px;
    border-left: 1px solid var(--line);
}

.content {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 32px 50px;
}

.page-header {
    min-height: 82px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(140, 229, 255, 0.55);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.25;
    text-shadow: 0 0 8px rgba(140, 229, 255, 0.24);
}

h1 {
    margin-bottom: 6px;
    font-size: 28px;
}

h2 {
    margin-bottom: 0;
    font-size: 16px;
}

h3 {
    font-size: 13px;
}

.page-header p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.panel,
.tool-card,
.result-panel,
.stat {
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(140, 229, 255, 0.045), rgba(201, 0, 214, 0.025)),
        var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel,
.result-panel {
    padding: 20px;
    margin-bottom: 18px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 19px;
}

.section-heading > div {
    min-width: 0;
}

.section-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.section-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(140, 229, 255, 0.34);
    border-radius: 7px;
    background: rgba(140, 229, 255, 0.12);
    box-shadow: 0 0 15px rgba(140, 229, 255, 0.12);
}

.section-icon img {
    width: 16px;
    height: 16px;
    opacity: 0.75;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat {
    min-height: 154px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    align-content: space-between;
    gap: 2px 10px;
    padding: 17px;
}

.stat-icon {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    border: 1px solid currentColor;
    box-shadow: 0 0 18px currentColor;
}

.stat-icon img {
    width: 17px;
    height: 17px;
    opacity: 0.78;
}

.stat-icon-blue {
    background: var(--primary-soft);
    color: rgba(140, 229, 255, 0.48);
}

.stat-icon-green {
    background: var(--green-soft);
    color: rgba(140, 229, 255, 0.48);
}

.stat-icon-amber {
    background: var(--amber-soft);
    color: rgba(232, 128, 31, 0.46);
}

.stat-icon-coral {
    background: var(--coral-soft);
    color: rgba(201, 0, 214, 0.44);
}

.stat-label {
    align-self: center;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 680;
}

.stat strong {
    grid-column: 1 / -1;
    align-self: end;
    overflow-wrap: anywhere;
    color: var(--ink-strong);
    font-size: 25px;
    font-weight: 760;
    line-height: 1.15;
}

.stat-detail {
    grid-column: 1 / -1;
    color: var(--muted-light);
    font-size: 11px;
}

.overview-grid,
.workspace-grid,
.moderation-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.workspace-primary {
    grid-row: span 1;
}

.server-list {
    display: grid;
}

.server-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    border-top: 1px solid var(--line);
}

.server-row:first-child {
    border-top: 0;
}

.server-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(140, 229, 255, 0.24);
    border-radius: 7px;
    background: rgba(140, 229, 255, 0.1);
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
}

.server-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.server-copy strong {
    overflow: hidden;
    color: var(--ink-strong);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

code,
pre {
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

code {
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 11px;
}

.command-code {
    display: inline-block;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: rgba(140, 229, 255, 0.08);
    color: var(--primary);
}

.status-badge {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 760;
    white-space: nowrap;
}

.status-badge > span:first-child {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-online,
.status-allowed {
    background: var(--green-soft);
    color: var(--primary);
}

.status-online > span:first-child {
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.status-restricted {
    background: rgba(201, 0, 214, 0.12);
    color: #e88cff;
}

.status-pending {
    background: var(--amber-soft);
    color: #ffb35e;
}

.status-denied {
    background: var(--danger-soft);
    color: #ff72fb;
}

.badge-icon {
    width: 12px;
    height: 12px;
    opacity: 0.72;
}

.action-list {
    display: grid;
    margin: -5px 0;
}

.action-list a {
    min-width: 0;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 11px;
    min-height: 59px;
    border-top: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

.action-list a:first-child {
    border-top: 0;
}

.action-list a:hover strong {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(140, 229, 255, 0.5);
}

.action-list a > img {
    width: 17px;
    height: 17px;
    opacity: 0.67;
}

.action-list a > span {
    min-width: 0;
    display: grid;
}

.action-list strong {
    font-size: 12px;
    transition: color 150ms ease;
}

.action-list small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-arrow {
    width: 14px !important;
    height: 14px !important;
    opacity: 0.4 !important;
}

form {
    display: grid;
    gap: 15px;
}

.field {
    min-width: 0;
    display: grid;
    gap: 7px;
}

label,
.label-row {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 720;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.label-row label {
    color: inherit;
}

.label-row span {
    color: var(--muted-light);
    font-size: 10px;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.form-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input-shell {
    position: relative;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    outline: 0;
    background: rgba(0, 0, 0, 0.64);
    color: var(--ink-strong);
    font-size: 13px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

input,
select {
    height: 40px;
    padding: 0 11px;
}

.input-shell input,
.input-shell select {
    padding-left: 36px;
}

.input-shell select {
    padding-right: 34px;
    appearance: none;
}

textarea {
    min-height: 104px;
    padding: 10px 11px;
    resize: vertical;
    line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
    color: #5f7f89;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(140, 229, 255, 0.58);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(140, 229, 255, 0.12), 0 0 18px rgba(140, 229, 255, 0.16);
}

.input-icon,
.select-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.45;
}

.input-icon {
    left: 12px;
}

.select-icon {
    right: 12px;
}

button,
.button {
    width: fit-content;
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid var(--amber);
    border-radius: 7px;
    background: var(--amber);
    color: #000000;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 720;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
    box-shadow: 0 0 18px rgba(232, 128, 31, 0.22);
}

button:hover,
.button:hover {
    border-color: #ff9a32;
    background: #ff9a32;
    box-shadow: 0 0 26px rgba(232, 128, 31, 0.36);
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(140, 229, 255, 0.25);
    outline-offset: 2px;
}

button:disabled {
    cursor: wait;
    opacity: 0.68;
}

.button-icon {
    width: 15px;
    height: 15px;
    filter: brightness(0);
}

.secondary-action {
    border-color: var(--line-strong);
    background: rgba(140, 229, 255, 0.08);
    color: var(--primary);
    box-shadow: none;
}

.secondary-action:hover {
    border-color: var(--primary);
    background: rgba(140, 229, 255, 0.14);
    box-shadow: 0 0 18px rgba(140, 229, 255, 0.18);
}

.secondary-action .button-icon {
    filter: brightness(0) invert(1);
    opacity: 0.72;
}

button.danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(201, 0, 214, 0.24);
}

button.danger:hover {
    border-color: var(--danger-dark);
    background: var(--danger-dark);
    box-shadow: 0 0 28px rgba(201, 0, 214, 0.4);
}

button.danger .button-icon {
    filter: brightness(0) invert(1);
}

.full {
    width: 100%;
}

.button-compact {
    min-height: 36px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.danger-panel {
    border-top: 3px solid var(--danger);
}

.danger-panel .section-icon {
    border-color: rgba(201, 0, 214, 0.42);
    background: var(--danger-soft);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.tool-card {
    min-width: 0;
    min-height: 228px;
    display: flex;
    flex-direction: column;
    padding: 19px;
}

.tool-card form {
    flex: 1;
    align-content: space-between;
}

.tool-card:nth-child(4) {
    grid-column: 1 / -1;
    min-height: 190px;
}

.tool-card-locked {
    background: rgba(8, 17, 26, 0.74);
}

.locked-state {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px dashed var(--line-strong);
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.locked-state img {
    width: 17px;
    height: 17px;
    opacity: 0.5;
}

.suggestion-list {
    display: grid;
    gap: 12px;
}

.suggestion-card {
    min-width: 0;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
}

.suggestion-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.suggestion-card-header > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.suggestion-card-header strong {
    overflow: hidden;
    color: var(--ink-strong);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-card-header span,
.suggestion-card p,
.suggestion-meta,
.suggestion-reviewed {
    color: var(--muted);
    font-size: 11px;
}

.suggestion-card p {
    margin: 0;
    color: var(--ink);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.suggestion-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-meta span,
.suggestion-reviewed {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.suggestion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-actions form {
    display: block;
}

.suggestion-denied {
    color: #ff72fb;
}

.access-panel {
    padding: 0;
    overflow: hidden;
}

.access-panel > summary {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px;
    cursor: pointer;
    list-style: none;
}

.access-panel > summary::-webkit-details-marker {
    display: none;
}

.access-panel > summary > span {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink-strong);
    font-size: 13px;
    font-weight: 720;
}

.summary-icon {
    opacity: 0.66;
}

.summary-meta {
    color: var(--muted) !important;
    font-size: 11px !important;
    font-weight: 620 !important;
}

.summary-meta img {
    width: 15px;
    height: 15px;
    opacity: 0.55;
    transition: transform 160ms ease;
}

.access-panel[open] .summary-meta img {
    transform: rotate(180deg);
}

.details-body {
    padding: 0 20px 18px;
    border-top: 1px solid var(--line);
}

.result-panel {
    border-left: 3px solid var(--primary);
}

.result-panel .section-heading {
    margin-bottom: 12px;
}

.result-panel .section-icon {
    border-color: rgba(140, 229, 255, 0.42);
    background: var(--green-soft);
}

pre {
    max-height: 360px;
    overflow: auto;
    margin: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.72);
    color: var(--ink);
    font-size: 11px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: rgba(140, 229, 255, 0.08);
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    color: var(--ink);
    font-size: 12px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: rgba(140, 229, 255, 0.055);
}

.message-cell {
    min-width: 280px;
    max-width: 520px;
}

.nowrap {
    white-space: nowrap;
}

.notice {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 11px;
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 7px;
}

.notice-icon {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    opacity: 0.75;
}

.notice-copy {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.notice-copy strong {
    font-size: 12px;
}

.notice-copy details summary {
    width: fit-content;
    cursor: pointer;
    font-size: 11px;
    font-weight: 680;
}

.notice-copy pre {
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.notice-success {
    border-color: rgba(140, 229, 255, 0.4);
    background: var(--green-soft);
    color: var(--primary);
}

.notice-error {
    border-color: rgba(201, 0, 214, 0.42);
    background: var(--danger-soft);
    color: #ff72fb;
}

.notice-info {
    border-color: rgba(140, 229, 255, 0.34);
    background: var(--primary-soft);
    color: var(--primary);
}

.empty-state {
    min-height: 154px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 24px;
    color: var(--muted);
    text-align: center;
}

.empty-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 3px;
    opacity: 0.38;
}

.empty-state strong {
    color: var(--ink);
    font-size: 12px;
}

.empty-state span {
    font-size: 11px;
}

.state-panel,
.state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 42px 24px;
    text-align: center;
}

.state-panel p,
.state-card p {
    max-width: 480px;
    margin: 8px auto 20px;
    color: var(--muted);
}

.state-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 50%;
}

.state-icon img {
    width: 21px;
    height: 21px;
    opacity: 0.75;
}

.state-icon-error {
    background: var(--danger-soft);
}

.state-icon-warning {
    background: var(--amber-soft);
}

.sidebar-scrim {
    display: none;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(rgba(140, 229, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 0, 214, 0.045) 1px, transparent 1px),
        #000000;
    background-size: 54px 54px;
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
}

.login-card {
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(140, 229, 255, 0.08), rgba(201, 0, 214, 0.04)),
        rgba(0, 0, 0, 0.92);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.login-brand {
    display: grid;
    justify-items: center;
    gap: 12px;
    color: var(--ink-strong);
    text-align: center;
}

.login-brand .brand-mark {
    width: min(260px, 100%);
    height: 216px;
    flex-basis: auto;
    background: transparent;
    filter: drop-shadow(0 0 18px rgba(140, 229, 255, 0.48)) drop-shadow(0 0 18px rgba(201, 0, 214, 0.24));
}

.login-brand .brand-copy strong {
    color: var(--ink-strong);
    font-size: 18px;
}

.login-brand .brand-copy > span {
    color: var(--amber);
}

.login-copy {
    margin: 30px 0 24px;
    text-align: center;
}

.login-copy h1 {
    margin-bottom: 8px;
    font-size: 28px;
}

.login-copy p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.discord-button {
    min-height: 44px;
    border-color: var(--primary);
    background: linear-gradient(90deg, var(--primary), var(--purple));
    color: #000000;
    box-shadow: 0 0 24px rgba(140, 229, 255, 0.28), 0 0 20px rgba(201, 0, 214, 0.18);
}

.discord-button:hover {
    border-color: #ffffff;
    background: linear-gradient(90deg, #b8f0ff, #f24cff);
}

.login-security {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 17px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
}

.login-security img {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    opacity: 0.55;
}

.result-modal {
    width: min(680px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-md);
}

.result-modal::backdrop {
    background: rgba(2, 4, 8, 0.78);
    backdrop-filter: blur(5px);
}

.modal-shell {
    display: flex;
    flex-direction: column;
    max-height: min(720px, calc(100vh - 32px));
}

.modal-header {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-raised);
}

.modal-header .eyebrow {
    margin-bottom: 3px;
}

.modal-header h2 {
    font-size: 16px;
}

.modal-status-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(140, 229, 255, 0.42);
    border-radius: 50%;
    background: var(--green-soft);
}

.modal-status-icon img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.78;
}

.modal-close {
    color: var(--ink);
}

.modal-close:hover {
    background: var(--surface-soft);
}

.modal-close img {
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.modal-body {
    min-height: 0;
    overflow: auto;
    padding: 20px;
}

.modal-body pre {
    max-height: 52vh;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    background: var(--surface-raised);
}

.settings-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.settings-index {
    position: sticky;
    top: calc(var(--topbar-height) + 18px);
    display: grid;
    gap: 3px;
    padding: 12px;
    margin: 0;
}

.settings-index .nav-label {
    margin: 4px 9px 8px;
}

.settings-index a {
    min-width: 0;
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 9px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 680;
    text-decoration: none;
}

.settings-index a:hover {
    background: var(--surface-soft);
    color: var(--ink-strong);
}

.settings-index img {
    width: 15px;
    height: 15px;
    filter: brightness(0) invert(1);
    opacity: 0.58;
}

.settings-form {
    min-width: 0;
    gap: 16px;
}

.settings-section {
    margin: 0;
    scroll-margin-top: calc(var(--topbar-height) + 18px);
}

.settings-section .section-heading {
    padding-bottom: 17px;
    border-bottom: 1px solid var(--line);
}

.moderation-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
}

.settings-toggle-list {
    display: grid;
    margin-bottom: 15px;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
}

.toggle-row {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 13px;
    border-top: 1px solid var(--line);
    cursor: pointer;
}

.toggle-row:first-child {
    border-top: 0;
}

.toggle-row > span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.toggle-row strong,
.category-option strong {
    color: var(--ink-strong);
    font-size: 11px;
}

.toggle-row small,
.category-option small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 520;
}

.toggle-row input[type="checkbox"] {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
    margin: 0;
    padding: 0;
    appearance: none;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(201, 0, 214, 0.12);
    cursor: pointer;
}

.toggle-row input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 150ms ease, background-color 150ms ease;
}

.toggle-row input[type="checkbox"]:checked {
    border-color: var(--green);
    background: var(--green-soft);
}

.toggle-row input[type="checkbox"]:checked::before {
    background: var(--green);
    transform: translateX(16px);
}

.moderation-fields {
    align-items: start;
}

.category-fieldset {
    min-width: 0;
    margin: 15px 0 0;
    padding: 0;
    border: 0;
}

.category-fieldset legend {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.category-option {
    min-width: 0;
    min-height: 60px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
    cursor: pointer;
}

.category-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.category-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 1px 0 0;
    accent-color: var(--primary);
}

.category-option > span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-settings-grid {
    grid-template-columns: 130px minmax(0, 1fr);
}

.dashboard-settings-grid .field-wide {
    grid-column: 1 / -1;
}

.path-grid {
    display: grid;
    gap: 13px;
}

.settings-savebar {
    position: sticky;
    z-index: 20;
    bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.settings-savebar > span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 10px;
}

.settings-savebar > span img {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
    opacity: 0.55;
}

@media (max-width: 1120px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat {
        min-height: 140px;
    }

    .overview-grid,
    .workspace-grid,
    .moderation-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-row: auto;
    }

    .settings-layout {
        grid-template-columns: 190px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    :root {
        --topbar-height: 58px;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        width: min(280px, calc(100vw - 44px));
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
        transition: transform 180ms ease;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-scrim {
        position: fixed;
        z-index: 50;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        display: block;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.62);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .sidebar-open .sidebar-scrim {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-close {
        display: inline-grid;
    }

    .app-shell {
        margin-left: 0;
    }

    .topbar {
        justify-content: flex-start;
        padding: 0 20px;
    }

    .menu-button {
        display: inline-grid;
        margin-right: auto;
        color: var(--ink);
    }

    .menu-button:hover {
        background: var(--surface-soft);
    }

    .topbar-context {
        display: none;
    }

    .topbar-time {
        padding-left: 0;
        border-left: 0;
    }

    .content {
        padding: 25px 20px 40px;
    }

    .page-header {
        min-height: 72px;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-index {
        position: static;
        display: flex;
        gap: 4px;
        overflow-x: auto;
        padding: 8px;
    }

    .settings-index .nav-label {
        display: none;
    }

    .settings-index a {
        flex: 0 0 auto;
        padding: 0 11px;
    }
}

@media (max-width: 650px) {
    .tool-grid,
    .form-grid,
    .form-grid-three {
        grid-template-columns: 1fr;
    }

    .tool-card:nth-child(4) {
        grid-column: auto;
    }

    .server-row {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .server-row .status-badge {
        grid-column: 2;
    }

    .role-grid,
    .dashboard-settings-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-settings-grid .field-wide {
        grid-column: auto;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 21px 14px 32px;
    }

    .topbar {
        padding: 0 14px;
    }

    .topbar-time {
        font-size: 10px;
    }

    .page-header {
        min-height: 68px;
        margin-bottom: 18px;
    }

    h1 {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat {
        min-height: 126px;
    }

    .panel,
    .result-panel,
    .tool-card {
        padding: 16px;
    }

    .access-panel {
        padding: 0;
    }

    .access-panel > summary {
        min-height: 58px;
        padding: 0 16px;
    }

    .details-body {
        padding: 0 16px 16px;
    }

    .summary-meta {
        font-size: 0 !important;
    }

    .form-actions,
    .form-actions button,
    .tool-card button,
    .danger-panel button {
        width: 100%;
    }

    .login-page {
        padding: 14px;
    }

    .login-card {
        padding: 22px;
    }

    .login-copy {
        margin-top: 36px;
    }

    .result-modal {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 15px;
        padding-right: 15px;
    }

    .modal-footer > button {
        flex: 1;
    }

    .settings-savebar {
        bottom: 8px;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .settings-savebar button {
        width: 100%;
    }

    .moderation-status-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
