:root {
    --staff-bg: var(--gothic-bg);
    --staff-sidebar: var(--gothic-field);
    --staff-surface: var(--gothic-surface);
    --staff-surface-raised: var(--gothic-raised);
    --staff-border: rgba(165, 148, 125, .12);
    --staff-border-strong: rgba(165, 148, 125, .22);
    --staff-text: #f0ead9;
    --staff-muted: var(--gothic-muted);
    --staff-gold: #d4bd79;
    --staff-gold-bright: #ead698;
    --staff-green: #73c69d;
    --staff-amber: #d9a45d;
    --staff-red: #d87e72;
    --sidebar-width: 248px;
}

.staff-body {
    display: block;
    min-width: 320px;
    padding: 0;
    color: var(--staff-text);
    background:
        radial-gradient(circle at 88% 0, rgba(69, 69, 70, .15), transparent 30rem),
        var(--staff-bg);
}

.staff-layout { min-height: 100vh; }

.staff-sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    border-right: 1px solid var(--staff-border);
    background: rgba(16, 16, 17, .97);
}

.sidebar-brand { padding: 1.65rem 1.35rem 1.45rem; }
.sidebar-brand a { display: flex; align-items: center; gap: .8rem; color: var(--staff-text); text-decoration: none; }
.sidebar-brand a > span:last-child { display: grid; gap: .1rem; }
.sidebar-brand strong { font-family: Georgia, serif; font-size: 1rem; letter-spacing: .12em; }
.sidebar-brand small { color: var(--staff-muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border: 1px solid var(--staff-gold);
    color: var(--staff-gold-bright);
    background: linear-gradient(145deg, rgba(165, 148, 125, .16), rgba(165, 148, 125, .02));
    font-family: Georgia, serif;
    font-size: 1.15rem;
    transform: rotate(45deg);
}
.brand-mark > span { transform: rotate(-45deg); }

.staff-nav { display: grid; gap: .3rem; padding: .35rem .8rem; }
.nav-label { padding: .45rem .72rem .35rem; color: var(--gothic-muted); font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-label-secondary { margin-top: 1rem; }
.staff-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .72rem .78rem;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--gothic-text-soft);
    font-size: .84rem;
    font-weight: 550;
    text-decoration: none;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.staff-nav a:hover { color: var(--staff-text); background: rgba(255, 255, 255, .025); }
.staff-nav a.active {
    border-color: rgba(165, 148, 125, .16);
    color: var(--staff-gold-bright);
    background: linear-gradient(90deg, rgba(165, 148, 125, .12), rgba(165, 148, 125, .035));
}
.staff-nav a.active::before { position: absolute; inset: .5rem auto .5rem -.82rem; width: 2px; background: var(--staff-gold); content: ""; }
.nav-icon { display: grid; width: 1.15rem; height: 1.15rem; place-items: center; }
.nav-icon svg { width: 100%; height: 100%; fill: currentColor; }

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid var(--staff-border);
}
.staff-identity { display: flex; min-width: 0; flex: 1; align-items: center; gap: .65rem; }
.staff-identity > span:last-child { display: grid; min-width: 0; gap: .08rem; }
.staff-identity strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; }
.staff-identity small { color: var(--staff-muted); font-size: .65rem; }
.identity-avatar, .table-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(165, 148, 125, .2);
    border-radius: 50%;
    color: var(--staff-gold-bright);
    background: var(--gothic-raised);
    font-weight: 700;
    text-transform: uppercase;
}
.identity-avatar { width: 2rem; height: 2rem; font-size: .7rem; }
.sidebar-footer form { display: block; margin: 0; }
.sidebar-signout { display: grid; width: 2rem; height: 2rem; padding: .45rem; place-items: center; border: 0; color: var(--staff-muted); background: transparent; }
.sidebar-signout:hover { color: var(--staff-gold); }
.sidebar-signout svg { width: 1rem; fill: currentColor; }

.staff-main { min-height: 100vh; margin-left: var(--sidebar-width); padding: clamp(1.5rem, 3vw, 3rem); }
.workspace-header { display: flex; max-width: 1440px; align-items: center; justify-content: space-between; gap: 2rem; margin: 0 auto 1.8rem; }
.workspace-header h1 { margin: .1rem 0 .35rem; color: var(--staff-text); font-family: Georgia, serif; font-size: clamp(1.75rem, 3vw, 2.45rem); }
.workspace-header p { margin: 0; color: var(--staff-muted); font-size: .9rem; }
.workspace-header .workspace-eyebrow { color: var(--staff-gold); font-size: .66rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.primary-action { border-radius: 4px; box-shadow: 0 7px 24px rgba(0, 0, 0, .2); white-space: nowrap; }

.server-switcher { max-width: 1440px; margin: 0 auto 1rem; overflow: hidden; border: 1px solid var(--staff-border); border-radius: 7px; background: rgba(21, 21, 22, .7); }
.server-switcher-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--staff-border); }
.server-switcher-heading > div { display: grid; gap: .12rem; }
.server-switcher-heading strong { font: 500 .95rem/1.2 Georgia, serif; }
.server-switcher-heading small { color: var(--staff-muted); font-size: .64rem; }
.server-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: .7rem; padding: .7rem; }
.server-tab { display: grid; min-width: 0; gap: .85rem; padding: .9rem; border: 1px solid var(--staff-border); border-radius: 6px; color: var(--staff-text); background: rgba(255, 255, 255, .012); text-align: left; }
.server-tab:hover:not(:disabled) { border-color: var(--staff-border-strong); background: rgba(165, 148, 125, .045); }
.server-tab.active { border-color: rgba(165, 148, 125, .45); background: rgba(165, 148, 125, .065); box-shadow: inset 0 -2px var(--staff-gold); }
.server-tab-top { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .65rem; }
.server-tab-top > i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--staff-amber); box-shadow: 0 0 0 4px rgba(217, 164, 93, .08); }
.server-tab.state-online .server-tab-top > i { background: var(--staff-green); box-shadow: 0 0 0 4px rgba(115, 198, 157, .08); }
.server-tab.state-disabled .server-tab-top > i { background: var(--gothic-muted); box-shadow: 0 0 0 4px rgba(106, 106, 107, .08); }
.server-tab-identity { display: grid; min-width: 0; gap: .13rem; }
.server-tab strong, .server-tab small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-tab strong { font-size: .74rem; }
.server-tab small { color: var(--staff-muted); font-size: .59rem; }
.server-tab-state { color: var(--staff-amber); font-size: .57rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.state-online .server-tab-state { color: var(--staff-green); }
.state-disabled .server-tab-state { color: var(--gothic-muted); }
.server-tab-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: .7rem; border-top: 1px solid rgba(165, 148, 125, .08); }
.server-tab-metrics > span { display: grid; min-width: 0; gap: .2rem; padding: 0 .55rem; border-right: 1px solid rgba(165, 148, 125, .08); }
.server-tab-metrics > span:first-child { padding-left: 0; }
.server-tab-metrics > span:last-child { padding-right: 0; border-right: 0; }
.server-tab-metrics b { overflow: hidden; color: var(--staff-text); font-size: .65rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.server-tab-placeholder { min-height: 112px; grid-template-columns: auto 1fr; align-content: center; align-items: center; opacity: .72; cursor: pointer; text-decoration: none; }
.server-tab-placeholder > span:last-child { display: grid; gap: .15rem; }
.server-add-icon { display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid var(--staff-border-strong); border-radius: 50%; color: var(--staff-gold); font-size: 1rem; }

.service-banner {
    display: flex;
    max-width: 1440px;
    align-items: center;
    gap: .8rem;
    margin: 0 auto 1rem;
    padding: .75rem 1rem;
    border: 1px solid rgba(115, 198, 157, .15);
    border-radius: 6px;
    background: rgba(64, 122, 94, .06);
}
.service-banner div { display: grid; gap: .12rem; }
.service-banner strong { font-size: .76rem; font-weight: 650; }
.service-banner small { color: var(--staff-muted); font-size: .68rem; }
.service-pulse { width: .48rem; height: .48rem; border-radius: 50%; background: var(--staff-green); box-shadow: 0 0 0 4px rgba(115, 198, 157, .1); }
.service-state { margin-left: auto; color: var(--staff-green); font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.status-separator { margin: 0 .35rem; color: var(--gothic-muted); }
.service-offline, .service-stale { border-color: rgba(217, 164, 93, .17); background: rgba(217, 164, 93, .045); }
.service-offline .service-pulse, .service-stale .service-pulse { background: var(--staff-amber); box-shadow: 0 0 0 4px rgba(217, 164, 93, .1); }
.service-offline .service-state, .service-stale .service-state { color: var(--staff-amber); }

.metric-grid { display: grid; max-width: 1440px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0 auto 1rem; }
.metric-card {
    position: relative;
    display: grid;
    min-height: 155px;
    padding: 1.15rem;
    overflow: hidden;
    border: 1px solid var(--staff-border);
    border-radius: 7px;
    background: linear-gradient(145deg, var(--staff-surface-raised), var(--staff-surface));
    box-shadow: 0 12px 32px rgba(0, 0, 0, .13);
}
.metric-card::after { position: absolute; inset: auto -2rem -3rem auto; width: 7rem; height: 7rem; border-radius: 50%; background: rgba(165, 148, 125, .025); content: ""; }
.metric-icon { display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid rgba(165, 148, 125, .15); border-radius: 5px; color: var(--staff-gold); background: rgba(165, 148, 125, .06); }
.metric-icon svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }
.metric-copy { display: flex; align-items: end; justify-content: space-between; gap: .5rem; margin-top: .8rem; }
.metric-copy span { color: var(--staff-muted); font-size: .75rem; }
.metric-copy strong { font: 500 1.95rem/1 Georgia, serif; }
.metric-card > small { align-self: end; color: var(--gothic-muted); font-size: .66rem; }
.metric-card > small b { margin-right: .2rem; color: var(--staff-green); font-weight: 650; }
.metric-primary { border-color: rgba(165, 148, 125, .27); background: linear-gradient(145deg, var(--gothic-raised), var(--gothic-surface)); }

.dashboard-grid { display: grid; max-width: 1440px; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .75fr); gap: 1rem; margin: 0 auto 1rem; }
.dashboard-panel, .quick-actions {
    border: 1px solid var(--staff-border);
    border-radius: 7px;
    background: rgba(21, 21, 22, .88);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .11);
}
.panel-title-row { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--staff-border); }
.panel-title-row h2, .quick-actions h2 { margin: 0 0 .22rem; color: var(--staff-text); font: 500 1rem/1.2 Georgia, serif; }
.panel-title-row p, .quick-actions p { margin: 0; color: var(--staff-muted); font-size: .68rem; }
.panel-title-row > a { color: var(--staff-gold); font-size: .7rem; text-decoration: none; }
.dashboard-table-wrap { overflow-x: auto; }
.dashboard-table { margin: 0; }
.dashboard-table th, .dashboard-table td { padding: .82rem 1.25rem; border-color: rgba(165, 148, 125, .08); }
.dashboard-table th { color: var(--gothic-muted); font-size: .61rem; letter-spacing: .09em; }
.dashboard-table td { color: var(--gothic-text-soft); font-size: .74rem; }
.dashboard-table td:first-child { display: flex; align-items: center; gap: .65rem; color: var(--staff-text); }
.table-avatar { width: 1.85rem; height: 1.85rem; font-size: .62rem; }
.dashboard-table time { white-space: nowrap; }
.status-pill { display: inline-block; padding: .27rem .5rem; border: 1px solid currentColor; border-radius: 999px; font-size: .55rem; font-weight: 700; letter-spacing: .07em; }
.status-active { color: var(--staff-green); background: rgba(115, 198, 157, .06); }
.status-suspended { color: var(--staff-amber); background: rgba(217, 164, 93, .06); }
.status-banned { color: var(--staff-red); background: rgba(216, 126, 114, .06); }
.row-action { display: grid; width: 1.75rem; height: 1.75rem; place-items: center; border: 1px solid var(--staff-border); border-radius: 4px; color: var(--staff-gold); text-decoration: none; }
.row-action:hover { border-color: var(--staff-border-strong); background: rgba(165, 148, 125, .05); }
.empty-cell { display: table-cell !important; color: var(--staff-muted) !important; text-align: center; }

.live-server-panel { max-width: 1440px; margin: 0 auto 1rem; }
.live-badge { padding: .3rem .55rem; border: 1px solid rgba(217, 164, 93, .3); border-radius: 999px; color: var(--staff-amber); background: rgba(217, 164, 93, .06); font-size: .57rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.live-badge-online { border-color: rgba(115, 198, 157, .3); color: var(--staff-green); background: rgba(115, 198, 157, .06); }
.live-server-content { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(360px, 1.4fr); }
.server-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 1.25rem; border-right: 1px solid var(--staff-border); gap: 1.2rem; }
.server-facts div { display: grid; min-width: 0; gap: .3rem; }
.server-facts dt { color: var(--gothic-muted); font-size: .6rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.server-facts dd { margin: 0; overflow: hidden; color: var(--staff-text); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.online-roster { min-width: 0; padding: 1.15rem 1.25rem 1.25rem; }
.roster-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.roster-heading strong { font-size: .72rem; }
.roster-heading span { display: grid; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; place-items: center; border-radius: 999px; color: var(--staff-green); background: rgba(115, 198, 157, .08); font-size: .62rem; }
.player-roster { display: grid; max-height: 195px; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-y: auto; gap: .55rem; }
.online-player { display: flex; min-width: 0; align-items: center; gap: .65rem; padding: .65rem .7rem; border: 1px solid rgba(165, 148, 125, .08); border-radius: 5px; background: rgba(255, 255, 255, .015); }
.online-player > span:last-child { display: grid; min-width: 0; gap: .1rem; }
.online-player strong, .online-player small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-player strong { font-size: .7rem; }
.online-player small { color: var(--staff-muted); font-size: .6rem; }
.online-player-avatar { display: grid; width: 1.75rem; height: 1.75rem; flex: 0 0 auto; place-items: center; border: 1px solid rgba(115, 198, 157, .2); border-radius: 50%; color: var(--staff-green); background: rgba(115, 198, 157, .06); font-size: .62rem; font-weight: 700; }
.roster-empty { grid-column: 1 / -1; margin: .6rem 0; color: var(--staff-muted); font-size: .68rem; text-align: center; }

.analytics-panel, .control-panel { max-width: 1440px; margin: 0 auto 1rem; }
.analytics-heading { align-items: center; }
.range-picker { display: flex; padding: .2rem; border: 1px solid var(--staff-border); border-radius: 5px; background: var(--gothic-field); }
.range-picker button { min-width: 2.5rem; padding: .38rem .55rem; border: 0; border-radius: 3px; color: var(--staff-muted); background: transparent; font-size: .58rem; font-weight: 700; }
.range-picker button:hover, .range-picker button.active { color: var(--staff-gold-bright); background: rgba(165, 148, 125, .1); }
.analytics-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--staff-border); }
.analytics-metrics > div { display: grid; padding: .9rem 1.15rem; border-right: 1px solid var(--staff-border); gap: .25rem; }
.analytics-metrics > div:last-child { border-right: 0; }
.analytics-metrics span { color: var(--staff-muted); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; }
.analytics-metrics strong { font: 500 1.05rem/1.2 Georgia, serif; }
.chart-grid { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr); }
.chart-card { min-width: 0; padding: 1.15rem 1.25rem 1.25rem; }
.population-card, .uptime-card { width: 100%; grid-column: 1 / -1; }
.chart-card + .chart-card { border-top: 1px solid var(--staff-border); }
.chart-card-heading { display: grid; margin-bottom: .75rem; gap: .15rem; }
.chart-card-heading strong { font-size: .7rem; }
.chart-card-heading small { color: var(--staff-muted); font-size: .59rem; }
.chart-frame { position: relative; min-height: 220px; }
.chart-frame svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-grid-line { stroke: rgba(165, 148, 125, .08); stroke-width: 1; }
.chart-axis-label { fill: var(--gothic-muted); font: 10px sans-serif; }
.chart-area { fill: url(#playerAreaGradient); }
.chart-line { fill: none; stroke: var(--staff-gold); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.25; }
.chart-point { fill: var(--staff-bg); stroke: var(--staff-gold-bright); stroke-width: 2; cursor: crosshair; }
.chart-point:hover, .chart-point:focus { fill: var(--staff-gold-bright); stroke: var(--staff-bg); outline: none; }
.chart-tooltip {
    position: absolute;
    z-index: 4;
    width: max-content;
    max-width: min(230px, calc(100% - 16px));
    padding: .58rem .65rem;
    border: 1px solid var(--staff-border-strong);
    border-radius: 5px;
    color: var(--staff-text);
    background: rgba(11, 11, 12, .96);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
    pointer-events: none;
}
.chart-tooltip strong { display: block; margin-bottom: .38rem; color: var(--staff-gold-bright); font-size: .62rem; }
.chart-tooltip > span { display: flex; justify-content: space-between; gap: 1rem; color: var(--staff-muted); font-size: .58rem; }
.chart-tooltip > span + span { margin-top: .2rem; }
.chart-tooltip b { color: var(--staff-text); font-weight: 650; }
.uptime-card { display: flex; flex-direction: column; }
.uptime-chart-frame { display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 670fr) minmax(0, 12fr); }
.uptime-chart-frame::after { content: ""; }
.uptime-scale { display: flex; height: 145px; flex-direction: column; justify-content: space-between; padding-right: 21%; color: var(--gothic-muted); font-size: .52rem; text-align: right; }
.uptime-plot { position: relative; height: 145px; border-bottom: 1px solid rgba(165, 148, 125, .12); }
.uptime-plot::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    background: linear-gradient(to bottom, rgba(165, 148, 125, .08) 1px, transparent 1px 49.5%, rgba(165, 148, 125, .08) 50%, transparent calc(50% + 1px));
    content: "";
    pointer-events: none;
}
.uptime-visual { position: absolute; z-index: 1; inset: 0; display: flex; min-width: 0; align-items: stretch; }
.uptime-slot { display: flex; min-width: 0; height: 100%; flex: 1 1 0; align-items: end; padding-inline: clamp(.5px, .175vw, 1.5px); border-radius: 2px; cursor: crosshair; }
.uptime-slot:focus { outline: 1px solid var(--staff-gold-bright); outline-offset: 2px; }
.uptime-bar { width: 100%; min-height: 4px; border-radius: 2px 2px 0 0; background: rgba(216, 126, 114, .72); }
.uptime-slot.online .uptime-bar { background: rgba(115, 198, 157, .82); }
.uptime-slot.partial .uptime-bar { background: rgba(217, 164, 93, .78); }
.uptime-slot.no-data .uptime-bar { height: 100% !important; background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(145, 145, 146, .13) 4px 6px); }
.uptime-time-axis { display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 335fr) minmax(0, 335fr) minmax(0, 12fr); margin-top: .4rem; color: var(--gothic-muted); font-size: .52rem; }
.uptime-time-axis span:first-child { grid-column: 2; justify-self: start; }
.uptime-time-axis span:last-child { grid-column: 3; justify-self: end; }
.uptime-context { display: flex; justify-content: space-between; margin-top: .75rem; color: var(--staff-muted); font-size: .56rem; }
.uptime-legend { display: flex; flex-wrap: wrap; gap: .9rem; color: var(--staff-muted); font-size: .57rem; }
.uptime-context + .uptime-legend { margin-top: .55rem; }
.uptime-legend span { display: flex; align-items: center; gap: .35rem; }
.uptime-legend i { width: .45rem; height: .45rem; border-radius: 2px; background: var(--staff-red); }
.uptime-legend i.online { background: var(--staff-green); }
.uptime-legend i.partial { background: var(--staff-amber); }
.uptime-legend i.no-data { background: repeating-linear-gradient(135deg, transparent 0 2px, rgba(145, 145, 146, .5) 2px 3px); }
.control-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .55fr); }
.agent-state { padding: .3rem .55rem; border: 1px solid rgba(217, 164, 93, .25); border-radius: 999px; color: var(--staff-amber); font-size: .56rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.agent-state.agent-online { border-color: rgba(115, 198, 157, .25); color: var(--staff-green); }
.control-actions { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); padding: 1rem 1.25rem; gap: .7rem; }
.server-control { display: grid; grid-template-columns: auto 1fr; padding: .72rem .8rem; border: 1px solid var(--staff-border); border-radius: 5px; color: var(--staff-text); background: rgba(255, 255, 255, .018); text-align: left; column-gap: .65rem; }
.server-control:hover:not(:disabled) { border-color: var(--staff-border-strong); background: rgba(165, 148, 125, .05); }
.server-control > span { grid-row: 1 / 3; align-self: center; color: var(--staff-gold); font-size: .9rem; }
.server-control strong { font-size: .67rem; }
.server-control small { color: var(--staff-muted); font-size: .56rem; }
.server-control.start > span { color: var(--staff-green); }
.server-control.danger > span { color: var(--staff-red); }
.server-control:disabled { opacity: .38; cursor: not-allowed; }
.control-actions-unavailable { align-self: center; padding: 1.25rem; color: var(--staff-muted); font-size: .68rem; }
.command-status { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.25rem; border-left: 1px solid var(--staff-border); }
.command-status > span:last-child { display: grid; min-width: 0; gap: .16rem; }
.command-status strong { font-size: .67rem; text-transform: capitalize; }
.command-status small { overflow: hidden; color: var(--staff-muted); font-size: .57rem; text-overflow: ellipsis; white-space: nowrap; }
.command-status-icon { display: grid; width: 1.8rem; height: 1.8rem; flex: 0 0 auto; place-items: center; border: 1px solid var(--staff-border); border-radius: 50%; color: var(--staff-gold); }

.health-panel { display: flex; min-width: 0; flex-direction: column; }
.health-score { display: flex; align-items: center; gap: 1rem; padding: 1.4rem 1.25rem 1rem; }
.health-score > div { display: grid; gap: .2rem; }
.health-score > div strong { font-size: .78rem; }
.health-score small { color: var(--staff-muted); font-size: .66rem; }
.health-ring {
    display: grid;
    width: 4.2rem;
    height: 4.2rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle closest-side, var(--staff-surface) 78%, transparent 80% 99%), conic-gradient(var(--staff-gold) calc(var(--score) * 1%), var(--gothic-raised) 0);
}
.health-ring strong { font-size: .78rem; }
.health-list { display: grid; gap: .7rem; padding: .2rem 1.25rem 1.15rem; }
.health-list > div { display: flex; align-items: center; justify-content: space-between; color: var(--staff-muted); font-size: .7rem; }
.health-list span { display: flex; align-items: center; gap: .5rem; }
.health-list strong { color: var(--staff-text); font-size: .75rem; }
.health-dot { width: .42rem; height: .42rem; border-radius: 50%; }
.dot-active { background: var(--staff-green); }
.dot-suspended { background: var(--staff-amber); }
.dot-banned { background: var(--staff-red); }
.panel-button { display: flex; align-items: center; justify-content: space-between; margin: auto 1.25rem 1.2rem; padding: .68rem .78rem; border: 1px solid var(--staff-border); border-radius: 4px; color: var(--gothic-text-soft); background: rgba(255,255,255,.015); font-size: .68rem; text-decoration: none; }
.panel-button span { color: var(--staff-gold); }

.quick-actions { display: grid; max-width: 1440px; grid-template-columns: minmax(170px, .7fr) repeat(4, minmax(180px, 1fr)); margin: 0 auto; overflow: hidden; }
.quick-actions-heading { padding: 1.15rem 1.25rem; }
.quick-actions > a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: 1rem; border-left: 1px solid var(--staff-border); color: var(--staff-text); text-decoration: none; transition: background .15s ease; }
.quick-actions > a:hover { background: rgba(165, 148, 125, .035); }
.quick-actions > a > span:nth-child(2) { display: grid; gap: .15rem; }
.quick-actions > a strong { font-size: .72rem; }
.quick-actions > a small { color: var(--staff-muted); font-size: .61rem; }
.quick-actions > a b { color: var(--staff-gold); font-size: .85rem; }
.quick-icon { display: grid; width: 1.8rem; height: 1.8rem; place-items: center; border: 1px solid var(--staff-border); border-radius: 4px; color: var(--staff-gold); background: rgba(165, 148, 125, .04); }

.workspace-card { max-width: 1440px; margin: 0 auto; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--staff-border); border-radius: 7px; background: rgba(21, 21, 22, .9); box-shadow: 0 18px 48px rgba(0, 0, 0, .18); }
.workspace-card .panel-heading { margin-bottom: 1.5rem; }
.workspace-card .panel-heading h1 { color: var(--staff-text); }
.workspace-card .table-wrap { border: 1px solid var(--staff-border); border-radius: 5px; }
.workspace-card table th, .workspace-card table td { border-color: var(--staff-border); }
.workspace-card .identity, .workspace-card .detail-grid > div, .workspace-card .session { background: var(--gothic-field); }
.credits-editor-card { max-width: 1100px; }
.credits-form { gap: 1rem; }
.editor-help { display: flex; justify-content: space-between; gap: 1rem; color: var(--staff-muted); font-size: .76rem; }
.editor-help strong { color: var(--staff-text); }
.rich-text-field { overflow: visible; border: 1px solid var(--staff-border-strong); border-radius: 5px; background: var(--gothic-field); }
.rich-text-field .ql-toolbar.ql-snow { display: flex; flex-wrap: wrap; gap: .15rem; padding: .65rem; border: 0; border-bottom: 1px solid var(--staff-border); border-radius: 5px 5px 0 0; background: var(--gothic-surface); font-family: Arial, sans-serif; }
.rich-text-field .ql-toolbar.ql-snow .ql-formats { display: inline-flex; align-items: center; margin-right: .45rem; }
.rich-text-field .ql-toolbar.ql-snow button { width: 2rem; height: 2rem; padding: .42rem; border: 1px solid transparent; border-radius: 3px; color: var(--gothic-text-soft); background: transparent; }
.rich-text-field .ql-toolbar.ql-snow button:hover,.rich-text-field .ql-toolbar.ql-snow button:focus,.rich-text-field .ql-toolbar.ql-snow button.ql-active { border-color: var(--staff-border-strong); color: var(--staff-gold-bright); background: rgba(165, 148, 125, .07); }
.rich-text-field .ql-snow .ql-stroke { stroke: currentColor; }
.rich-text-field .ql-snow .ql-fill,.rich-text-field .ql-snow .ql-stroke.ql-fill { fill: currentColor; }
.rich-text-field .ql-snow .ql-picker { color: var(--gothic-text-soft); }
.rich-text-field .ql-snow .ql-picker-label { border-color: transparent; border-radius: 3px; }
.rich-text-field .ql-snow .ql-picker-label:hover,.rich-text-field .ql-snow .ql-picker-label.ql-active { border-color: var(--staff-border-strong); color: var(--staff-gold-bright); }
.rich-text-field .ql-snow .ql-picker-options { border-color: var(--staff-border-strong); color: var(--gothic-text-soft); background: var(--gothic-surface); box-shadow: 0 12px 28px rgba(0,0,0,.4); }
.rich-text-field .ql-container.ql-snow { border: 0; border-radius: 0 0 5px 5px; color: #c8c1af; font: 1rem/1.75 Georgia,serif; }
.rich-text-field .ql-editor { min-height: 360px; padding: clamp(1.25rem,4vw,2.5rem); }
.rich-text-field .ql-editor.ql-blank::before { left: clamp(1.25rem,4vw,2.5rem); right: clamp(1.25rem,4vw,2.5rem); color: var(--gothic-muted); font-style: normal; }
.rich-text-field .ql-editor h2,.rich-text-field .ql-editor h3 { color: var(--staff-text); font-family: Georgia,serif; font-weight: 500; }
.rich-text-field .ql-editor h2 { margin: 1.7rem 0 .65rem; font-size: 1.8rem; }
.rich-text-field .ql-editor h2:first-child { margin-top: 0; }
.rich-text-field .ql-editor h3 { margin: 1.35rem 0 .5rem; font-size: 1.25rem; }
.rich-text-field .ql-editor p,.rich-text-field .ql-editor ul,.rich-text-field .ql-editor ol,.rich-text-field .ql-editor blockquote,.rich-text-field .ql-editor pre { margin-bottom: 1rem; }
.rich-text-field .ql-editor a { color: var(--staff-gold-bright); }
.rich-text-field .ql-editor blockquote { border-color: var(--staff-gold); color: #aaa38f; font-style: italic; }
.rich-text-field .ql-editor pre { border: 1px solid var(--staff-border); border-radius: 3px; background: var(--gothic-bg); }
.rich-text-field .ql-snow .ql-tooltip { border-color: var(--staff-border-strong); color: var(--staff-text); background: var(--gothic-surface); box-shadow: 0 12px 28px rgba(0,0,0,.4); }
.rich-text-field .ql-snow .ql-tooltip input[type=text] { border-color: var(--staff-border-strong); color: var(--staff-text); background: var(--gothic-field); }
.rich-text-field .ql-snow .ql-tooltip a { color: var(--staff-gold-bright); }
.rich-text-history button { font-size: 1.15rem; line-height: 1; }
.credits-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.credits-editor-footer .meta { max-width: 650px; margin: 0; }
.credits-editor-footer button { flex: 0 0 auto; }

/* Character Explorer */
.character-workspace-header { margin-bottom: 1rem; }
.read-only-badge, .result-scope {
    display: inline-flex;
    align-items: center;
    padding: .38rem .65rem;
    border: 1px solid var(--staff-border-strong);
    border-radius: 999px;
    color: var(--staff-gold);
    background: rgba(165, 148, 125, .05);
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.explorer-panel, .character-panel, .character-hero, .integrity-banner {
    max-width: 1440px;
    margin: 0 auto 1rem;
    border: 1px solid var(--staff-border);
    border-radius: 7px;
    background: rgba(21, 21, 22, .9);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .11);
}
.character-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    align-items: end;
    margin: 0;
    padding: 1.15rem;
    gap: .8rem;
}
.character-filter label { color: var(--staff-muted); font-size: .66rem; }
.character-filter input, .character-filter select {
    min-width: 0;
    padding: .68rem .72rem;
    border-color: var(--staff-border);
    border-radius: 4px;
    color: var(--staff-text);
    background: var(--gothic-field);
    font-size: .72rem;
}
.filter-wide { grid-column: span 2; }
.filter-actions { display: flex; align-items: center; gap: .75rem; }
.filter-actions button { flex: 1; padding: .72rem; border-radius: 4px; }
.filter-actions a { color: var(--staff-muted); font-size: .64rem; text-decoration: none; white-space: nowrap; }
.filter-actions a:hover { color: var(--staff-gold); }
.result-panel { overflow: hidden; }
.character-result-list { display: grid; }
.character-result {
    display: grid;
    grid-template-columns: auto minmax(180px, 1.25fr) 65px minmax(150px, .75fr) minmax(150px, .8fr) minmax(150px, .8fr) auto;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid rgba(165, 148, 125, .08);
    color: var(--staff-text);
    text-decoration: none;
    transition: background .15s ease;
}
.character-result:last-child { border-bottom: 0; }
.character-result:hover { background: rgba(165, 148, 125, .04); }
.character-avatar {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid rgba(165, 148, 125, .23);
    border-radius: 5px;
    color: var(--staff-gold-bright);
    background: linear-gradient(145deg, var(--gothic-raised), var(--gothic-raised));
    font: 500 1rem/1 Georgia, serif;
}
.character-primary, .character-fact, .character-state { display: grid; min-width: 0; gap: .18rem; }
.character-primary strong { overflow: hidden; font: 500 .84rem/1.2 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.character-primary small { overflow: hidden; color: var(--staff-muted); font-size: .56rem; text-overflow: ellipsis; white-space: nowrap; }
.character-fact small, .character-state small { color: var(--gothic-muted); font-size: .54rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.character-fact strong { overflow: hidden; color: var(--gothic-text-soft); font-size: .66rem; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.character-state b { color: var(--staff-muted); font-size: .61rem; letter-spacing: .06em; text-transform: uppercase; }
.character-state b.online { color: var(--staff-green); }
.character-state b.deleted { color: var(--staff-red); }
.result-arrow { color: var(--staff-gold); }
.character-empty { display: grid; justify-items: center; padding: 4rem 1rem; color: var(--staff-muted); text-align: center; gap: .45rem; }
.character-empty strong { color: var(--staff-text); font: 500 1rem/1.2 Georgia, serif; }
.character-empty span { font-size: .7rem; }
.explorer-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: .85rem 1.15rem; border-top: 1px solid var(--staff-border); color: var(--staff-muted); font-size: .66rem; }
.explorer-pagination a { color: var(--staff-gold); text-decoration: none; }
.explorer-pagination a:last-child { justify-self: end; }
.explorer-pagination span { grid-column: 2; }

.back-link { display: block; max-width: 1440px; margin: 0 auto .8rem; color: var(--staff-muted); font-size: .68rem; text-decoration: none; }
.back-link:hover { color: var(--staff-gold); }
.character-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 1.25rem; gap: 1rem; }
.hero-avatar { width: 3.8rem; height: 3.8rem; font-size: 1.5rem; }
.character-identity h1 { margin: .08rem 0 .28rem; font: 500 clamp(1.55rem, 3vw, 2.2rem)/1.05 Georgia, serif; }
.character-identity p { margin: 0; color: var(--staff-muted); font-size: .72rem; }
.character-identity .workspace-eyebrow { color: var(--staff-gold); font-size: .58rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.hero-status { display: grid; justify-items: end; gap: .45rem; }
.hero-status > small { color: var(--staff-muted); font-size: .62rem; }
.hero-status .status-pill:not(.status-active):not(.status-banned) { color: var(--staff-muted); }
.integrity-banner { padding: .85rem 1rem; border-color: rgba(217, 164, 93, .32); color: var(--staff-amber); background: rgba(217, 164, 93, .055); }
.integrity-banner strong { font-size: .7rem; }
.integrity-banner ul { margin: .45rem 0 0; padding-left: 1.15rem; color: #c3ae89; font-size: .65rem; }
.character-tabs { display: flex; max-width: 1440px; margin: 0 auto 1rem; overflow-x: auto; border: 1px solid var(--staff-border); border-radius: 6px; background: rgba(21, 21, 22, .8); }
.character-tabs a { flex: 1 0 auto; padding: .72rem .8rem; border-right: 1px solid var(--staff-border); color: var(--staff-muted); font-size: .64rem; font-weight: 650; text-align: center; text-decoration: none; }
.character-tabs a:last-child { border-right: 0; }
.character-tabs a:hover, .character-tabs a.active { color: var(--staff-gold-bright); background: rgba(165, 148, 125, .055); }
.character-tabs a.active { box-shadow: inset 0 -2px var(--staff-gold); }
.character-panel { overflow: hidden; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.25rem; border-bottom: 1px solid var(--staff-border); }
.section-heading h2 { margin: 0 0 .25rem; font: 500 1.15rem/1.2 Georgia, serif; }
.section-heading p { margin: 0; color: var(--staff-muted); font-size: .67rem; }
.character-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--staff-border); }
.character-facts > div { display: grid; min-width: 0; padding: .9rem 1rem; border-right: 1px solid var(--staff-border); border-bottom: 1px solid rgba(165, 148, 125, .06); gap: .25rem; }
.character-facts > div:nth-child(4n) { border-right: 0; }
.character-facts dt, .data-card dt, .compact-facts dt, .map-dl dt { color: var(--gothic-muted); font-size: .55rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.character-facts dd, .data-card dd, .compact-facts dd, .map-dl dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--gothic-text-soft); font-size: .69rem; }
.character-facts a { color: var(--staff-gold); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.data-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 1rem 1.25rem; gap: .8rem; }
.compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 0; }
.data-card { min-width: 0; padding: 1rem; border: 1px solid var(--staff-border); border-radius: 5px; background: var(--gothic-field); }
.data-card h3, .subsection h3, .split-tables h3, .discovery-grid h3 { margin: 0 0 .8rem; color: var(--staff-text); font: 500 .83rem/1.2 Georgia, serif; }
.data-card dl, .map-dl { display: grid; margin: 0; gap: .62rem; }
.data-card dl > div, .map-dl > div { display: grid; gap: .14rem; }
.subsection { padding: 1.15rem 1.25rem; border-top: 1px solid var(--staff-border); }
.first-subsection { border-top: 0; }
.compact-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; border: 1px solid var(--staff-border); border-radius: 4px; }
.compact-facts > div { display: grid; min-width: 0; padding: .7rem .8rem; border-right: 1px solid var(--staff-border); gap: .18rem; }
.empty-inline { margin: 0; color: var(--staff-muted); font-size: .67rem; }
.triple-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--staff-border); border-radius: 5px; }
.triple-list.two-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.triple-list > div { display: grid; align-content: start; padding: .85rem; border-right: 1px solid var(--staff-border); gap: .35rem; }
.triple-list > div:last-child { border-right: 0; }
.triple-list strong { margin-bottom: .25rem; color: var(--staff-gold); font-size: .63rem; text-transform: uppercase; }
.triple-list span, .triple-list small { color: var(--gothic-text-soft); font-size: .64rem; overflow-wrap: anywhere; }
.triple-list small { color: var(--staff-muted); }
.section-metrics { display: flex; flex-wrap: wrap; justify-content: end; gap: .5rem; }
.section-metrics span { padding: .35rem .55rem; border: 1px solid var(--staff-border); border-radius: 4px; color: var(--staff-muted); font-size: .58rem; }
.section-metrics b { color: var(--staff-gold-bright); }
.data-table-wrap { max-width: 100%; overflow-x: auto; }
.data-table { margin: 0; }
.data-table th, .data-table td { padding: .72rem .8rem; border-color: rgba(165, 148, 125, .08); font-size: .64rem; vertical-align: top; }
.data-table th { color: var(--gothic-muted); font-size: .54rem; letter-spacing: .08em; white-space: nowrap; }
.data-table td { color: var(--gothic-text-soft); }
.data-table .empty-cell { padding: 2.5rem 1rem; }
.storage-pill { display: inline-block; padding: .25rem .4rem; border: 1px solid rgba(115, 198, 157, .3); border-radius: 999px; color: var(--staff-green); font-size: .5rem; font-weight: 700; }
.storage-pill.bank { border-color: rgba(165, 148, 125, .3); color: var(--staff-gold); }
.split-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-tables > div { min-width: 0; padding: 1.15rem 1.25rem; border-right: 1px solid var(--staff-border); }
.split-tables > div:last-child { border-right: 0; }
.record-chip-list { display: flex; flex-wrap: wrap; padding: 1.15rem 1.25rem; gap: .45rem; }
.record-chip { padding: .4rem .55rem; border: 1px solid var(--staff-border); border-radius: 4px; color: var(--gothic-text-soft); background: var(--gothic-field); }
.discovery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.discovery-grid > div { min-width: 0; padding: 1.15rem 1.25rem; border-right: 1px solid var(--staff-border); }
.discovery-grid > div:last-child { border-right: 0; }
.scrolling-record-list { display: grid; max-height: 320px; overflow-y: auto; border: 1px solid var(--staff-border); }
.scrolling-record-list span, .scrolling-record-list small { padding: .48rem .6rem; border-bottom: 1px solid rgba(165, 148, 125, .07); color: var(--gothic-text-soft); font-size: .61rem; }
.scrolling-record-list small { color: var(--staff-muted); }
.lease-card { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1.15rem 1.25rem; border: 1px solid var(--staff-border); border-radius: 5px; background: var(--gothic-field); }
.lease-card.active { border-color: rgba(115, 198, 157, .3); }
.lease-card > div { display: grid; min-width: 0; padding: .85rem; border-right: 1px solid var(--staff-border); gap: .2rem; }
.lease-card > div:last-child { border-right: 0; }
.lease-card small { color: var(--staff-muted); font-size: .55rem; text-transform: uppercase; }
.lease-card strong { overflow-wrap: anywhere; font-size: .66rem; }
.mutation-list { display: grid; border: 1px solid var(--staff-border); border-radius: 4px; }
.mutation-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: .75rem .85rem; border-bottom: 1px solid var(--staff-border); gap: .35rem 1rem; }
.mutation-list article:last-of-type { border-bottom: 0; }
.mutation-list article > div { display: flex; flex-wrap: wrap; gap: .55rem; }
.mutation-list strong { color: var(--staff-text); font-size: .65rem; }
.mutation-list span, .mutation-list small { color: var(--staff-muted); font-size: .58rem; }
.mutation-list details { grid-column: 1 / -1; }
.mutation-list summary, .json-records summary { color: var(--staff-gold); font-size: .59rem; cursor: pointer; }
.json-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .65rem; gap: .65rem; }
.json-grid b { color: var(--staff-muted); font-size: .55rem; text-transform: uppercase; }
pre { max-height: 360px; margin: .35rem 0 0; padding: .75rem; overflow: auto; border: 1px solid var(--staff-border); color: var(--gothic-text-soft); background: var(--gothic-bg); font: .58rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.hash { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.json-records { display: grid; border: 1px solid var(--staff-border); border-radius: 4px; }
.json-records details { padding: .72rem .8rem; border-bottom: 1px solid var(--staff-border); }
.json-records details:last-of-type { border-bottom: 0; }
.json-records summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.json-records summary strong { color: var(--staff-text); }
.json-records summary span { color: var(--staff-muted); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.rank-card { position: relative; display: grid; padding: 1rem; border: 1px solid var(--staff-border); border-radius: 6px; color: var(--staff-text); background: var(--staff-surface); text-decoration: none; gap: .3rem; }
.rank-card:hover { border-color: var(--staff-border-strong); }
.rank-card code, .permission-node code { color: var(--staff-gold); font-size: .65rem; }
.rank-card small, .permission-node small, .danger-zone small { color: var(--staff-muted); font-size: .6rem; }
.rank-tag { color: var(--rank-color, var(--staff-gold-bright)); font-size: .65rem; }
.system-badge { position: absolute; top: .8rem; right: .8rem; color: var(--staff-muted); font-size: .54rem; text-transform: uppercase; }
.permission-form { display: grid; gap: 1.2rem; }
.permission-basics { display: grid; grid-template-columns: 1fr 1fr 1fr 120px 120px; gap: .8rem; }
.permission-basics label, .rank-assignment label { display: grid; gap: .35rem; }
.permission-basics input[type="color"] { width: 100%; min-height: 42px; padding: .2rem; cursor: pointer; }
.permission-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.permission-groups fieldset { display: grid; align-content: start; margin: 0; padding: .8rem; border: 1px solid var(--staff-border); border-radius: 5px; gap: .45rem; }
.permission-groups legend { padding: 0 .35rem; color: var(--staff-text); font-size: .72rem; }
.permission-node { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .55rem; }
.permission-node span { display: grid; gap: .12rem; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; margin-top: 1.2rem; padding: 1rem; border: 1px solid rgba(216, 126, 114, .25); border-radius: 5px; }
.danger-zone div { display: grid; gap: .2rem; }
.assigned-ranks { display: grid; margin: .7rem 0; gap: .45rem; }
.assigned-ranks form { display: flex; align-items: center; justify-content: space-between; padding: .6rem .7rem; border: 1px solid var(--staff-border); border-radius: 4px; }
.assigned-ranks form span { display: grid; }
.assigned-ranks small { color: var(--staff-muted); }
.rank-assignment { display: flex; align-items: end; gap: .6rem; margin-top: .7rem; }
.rank-scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: .7rem 0; border: 1px solid var(--staff-border); border-radius: 5px; }
.rank-scope-grid > div { display: flex; flex-wrap: wrap; align-content: start; align-items: center; padding: .8rem; gap: .45rem; }
.rank-scope-grid > div + div { border-left: 1px solid var(--staff-border); }
.rank-scope-grid > div > strong { width: 100%; font-size: .65rem; }
.rank-scope-grid form { display: flex; align-items: center; gap: .3rem; }
.rank-chip { padding: .25rem .45rem; border: 1px solid rgba(165, 148, 125, .25); border-radius: 999px; color: var(--staff-gold); font-size: .58rem; }
.server-manager-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.server-manager-card { display: grid; align-content: start; min-height: 145px; padding: 1rem; border: 1px solid var(--staff-border); border-radius: 6px; color: var(--staff-text); background: var(--staff-surface); text-decoration: none; gap: .3rem; }
.server-manager-card:hover { border-color: var(--staff-border-strong); }
.server-manager-card code { color: var(--staff-gold); font-size: .65rem; }
.server-manager-card small { color: var(--staff-muted); font-size: .6rem; overflow-wrap: anywhere; }
.server-manager-state { justify-self: start; padding: .2rem .4rem; border-radius: 999px; color: var(--staff-muted); background: var(--gothic-raised); font-size: .52rem; text-transform: uppercase; }
.server-manager-state.enabled { color: var(--staff-green); background: rgba(115, 198, 157, .1); }
.server-manager-add { place-content: center; justify-items: center; text-align: center; }
.server-manager-add b { color: var(--staff-gold); font-size: 1.5rem; }
.server-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.server-form-grid > label { display: grid; align-content: start; gap: .35rem; }
.server-form-grid small, .server-access-ranks .meta { color: var(--staff-muted); font-size: .6rem; }
.server-enabled { align-self: end; min-height: 42px; }
.server-access-ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 0; padding: 1rem; border: 1px solid var(--staff-border); border-radius: 5px; gap: .65rem; }
.server-access-ranks legend { padding: 0 .35rem; }
.server-access-ranks .meta { grid-column: 1 / -1; margin: 0 0 .35rem; }

@media (max-width: 1120px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-actions { grid-template-columns: repeat(3, 1fr); }
    .quick-actions-heading { grid-column: 1 / -1; border-bottom: 1px solid var(--staff-border); }
    .quick-actions > a:first-of-type { border-left: 0; }
    .character-filter { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
    .character-result { grid-template-columns: auto minmax(180px, 1.25fr) 60px minmax(150px, 1fr) minmax(150px, 1fr) auto; }
    .character-result .character-fact:nth-of-type(4) { display: none; }
    .data-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .staff-sidebar { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--staff-border); }
    .sidebar-brand { padding: .85rem 1rem; }
    .sidebar-brand small, .nav-label, .sidebar-footer { display: none; }
    .brand-mark { width: 1.75rem; height: 1.75rem; font-size: .9rem; }
    .staff-nav { display: flex; padding: 0 .65rem .65rem; overflow-x: auto; }
    .staff-nav a { flex: 0 0 auto; padding: .55rem .7rem; }
    .staff-nav a.active::before { inset: auto .55rem -.65rem; width: auto; height: 2px; }
    .nav-label-secondary { display: none; }
    .staff-main { margin-left: 0; padding: 1.25rem; }
    .live-server-content { grid-template-columns: 1fr; }
    .server-facts { border-right: 0; border-bottom: 1px solid var(--staff-border); }
    .server-tabs { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
    .analytics-metrics { grid-template-columns: repeat(2, 1fr); }
    .analytics-metrics > div:nth-child(2) { border-right: 0; }
    .analytics-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--staff-border); }
    .control-content { grid-template-columns: 1fr; }
    .command-status { border-top: 1px solid var(--staff-border); border-left: 0; }
    .character-filter { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .character-result { grid-template-columns: auto minmax(180px, 1fr) minmax(130px, .7fr) auto; }
    .character-result .character-fact { display: none; }
    .character-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .character-facts > div:nth-child(2n) { border-right: 0; }
    .character-facts > div:nth-child(2n + 1) { border-right: 1px solid var(--staff-border); }
    .split-tables, .discovery-grid { grid-template-columns: 1fr; }
    .split-tables > div, .discovery-grid > div { border-right: 0; border-bottom: 1px solid var(--staff-border); }
    .split-tables > div:last-child, .discovery-grid > div:last-child { border-bottom: 0; }
    .lease-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .permission-basics, .permission-groups { grid-template-columns: 1fr 1fr; }
    .lease-card > div:nth-child(2) { border-right: 0; }
    .lease-card > div:nth-child(-n+2) { border-bottom: 1px solid var(--staff-border); }
}

@media (max-width: 650px) {
    .workspace-header { align-items: stretch; flex-direction: column; gap: 1rem; }
    .workspace-header .button { width: 100%; }
    .server-switcher-heading { align-items: start; flex-direction: column; }
    .server-tabs { grid-template-columns: 1fr; }
    .service-banner small { display: none; }
    .metric-grid, .dashboard-grid { grid-template-columns: 1fr; }
    .server-facts, .player-roster { grid-template-columns: 1fr; }
    .metric-card { min-height: 140px; }
    .analytics-heading { align-items: stretch; flex-direction: column; }
    .range-picker { width: 100%; }
    .range-picker button { flex: 1; }
    .control-actions { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .quick-actions > a { border-top: 1px solid var(--staff-border); border-left: 0; }
    .dashboard-table th:nth-child(3), .dashboard-table td:nth-child(3) { display: none; }
    .character-filter { grid-template-columns: 1fr; }
    .filter-wide { grid-column: auto; }
    .character-result { grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; }
    .character-result .character-state { display: none; }
    .character-hero { grid-template-columns: auto 1fr; }
    .hero-status { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; justify-items: start; }
    .character-facts, .data-card-grid, .compact-grid, .triple-list, .triple-list.two-list { grid-template-columns: 1fr; }
    .character-facts > div, .character-facts > div:nth-child(2n + 1), .triple-list > div { border-right: 0; border-bottom: 1px solid var(--staff-border); }
    .triple-list > div:last-child { border-bottom: 0; }
    .section-heading { flex-direction: column; }
    .section-metrics { justify-content: start; }
    .lease-card { grid-template-columns: 1fr; }
    .lease-card > div, .lease-card > div:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--staff-border); }
    .lease-card > div:last-child { border-bottom: 0; }
    .mutation-list article { grid-template-columns: 1fr; }
    .json-grid { grid-template-columns: 1fr; }
    .json-records summary { align-items: start; flex-direction: column; }
    .permission-basics, .permission-groups, .rank-scope-grid { grid-template-columns: 1fr; }
    .server-form-grid { grid-template-columns: 1fr; }
    .rank-scope-grid > div + div { border-top: 1px solid var(--staff-border); border-left: 0; }
    .rank-assignment { align-items: stretch; flex-direction: column; }
    .editor-help,.credits-editor-footer { align-items: stretch; flex-direction: column; }
    .credits-editor-footer button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .staff-nav a, .quick-actions > a { transition: none; }
}

.node-add-fields, .node-edit-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
.node-add-fields label, .node-edit-fields label { display: grid; align-content: start; gap: .4rem; }
.node-add-fields small, .node-delete small { color: var(--staff-muted); }
.node-description-field { grid-column: 1 / -1; }
.node-table-scroll { overflow-x: auto; }
.node-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .8rem; }
.node-table th, .node-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--staff-border); vertical-align: top; }
.node-table th { color: var(--staff-muted); }
.node-table th button { display: flex; align-items: center; gap: .5rem; padding: 0; background: transparent; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.node-table th button:hover { color: var(--staff-gold); }
.node-table tbody.node-stripe { background: rgba(255, 255, 255, .045); }
.node-table tbody:hover .node-data-row { background: rgba(255, 255, 255, .035); }
.node-table td:first-child { width: 30%; overflow-wrap: anywhere; }
.node-table td:nth-child(2) { width: 20%; }
.node-table td:nth-child(3) { overflow-wrap: anywhere; }
.node-table td:last-child button { padding: .35rem .7rem; }
.node-table .node-editor-row > td { padding: 0; }
.node-editor-row[hidden] { display: none; }
.node-inline-editor { position: relative; padding: 1rem; border-left: 3px solid var(--staff-gold); }
.node-inline-editor .permission-form > p { padding-right: 2rem; }
.node-close { position: absolute; top: .6rem; right: .6rem; font-size: 1.3rem; line-height: 1; }
.node-delete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
@media (max-width: 650px) {
    .node-add-fields, .node-edit-fields { grid-template-columns: 1fr; }
    .node-table { min-width: 650px; }
}
