:root {
    --bg: #04060d;
    --panel: rgba(8, 12, 24, 0.94);
    --panel-strong: rgba(10, 15, 29, 0.98);
    --line: rgba(255, 42, 116, 0.42);
    --text: #e8edf7;
    --muted: #9099ab;
    --pip: #ff2a74;
    --pip-strong: #ff4b91;
    --amber: #ff3f83;
    --cyan: #4de9ff;
    --danger: #ff466e;
    --good: #00f58a;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

* {
    scrollbar-color: rgba(255, 42, 116, 0.74) rgba(7, 10, 19, 0.86);
    scrollbar-width: thin;
}

html {
    background: var(--bg);
}

body {
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(90deg, rgba(255, 28, 99, 0.025) 1px, transparent 1px),
        linear-gradient(rgba(77, 233, 255, 0.018) 1px, transparent 1px),
        radial-gradient(circle at 76% 2%, rgba(42, 48, 108, 0.16), transparent 34%),
        #04060d;
    background-size: 72px 72px, 72px 72px, auto, auto;
}

body::before {
    z-index: 20;
    opacity: 0.18;
    mix-blend-mode: screen;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 19;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 52%, rgba(0, 0, 0, 0.5));
}

.shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    background: transparent;
    border: 0;
    box-shadow: none;
}

.shell::after {
    display: none;
}

.side-rail {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 100vh;
    height: 100vh;
    padding: 24px 14px 18px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(255, 27, 98, 0.05), transparent 18%),
        rgba(5, 7, 15, 0.96);
    border-right: 1px solid rgba(255, 42, 116, 0.32);
    box-shadow: 14px 0 60px rgba(0, 0, 0, 0.28);
}

.brand {
    padding: 0 14px 24px;
    border-bottom: 1px solid rgba(255, 42, 116, 0.24);
}

.brand-mark {
    font-family: "Rajdhani", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    font-style: italic;
    line-height: 0.86;
    letter-spacing: 0.08em;
    color: var(--pip-strong);
    text-shadow: 2px 0 rgba(77, 233, 255, 0.28), 0 0 24px rgba(255, 42, 116, 0.36);
}

.brand-sub {
    margin-top: 8px;
    color: var(--cyan);
    font-size: 0.69rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.rail-group {
    margin-top: 24px;
}

.rail-system-group {
    margin-top: 20px;
}

.rail-label {
    padding: 0 8px 8px;
    color: var(--cyan);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

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

.rail-link {
    width: 100%;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #aab2c1;
    text-align: left;
    text-transform: none;
    letter-spacing: 0.01em;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
}

.rail-link i {
    width: 18px;
    flex: 0 0 18px;
    color: #697386;
    text-align: center;
}

.rail-link:hover:not(:disabled),
.rail-link.active {
    color: #fff;
    border-color: rgba(255, 42, 116, 0.44);
    background: linear-gradient(90deg, rgba(255, 42, 116, 0.26), rgba(255, 42, 116, 0.02));
    box-shadow: inset 3px 0 var(--pip), 0 0 22px rgba(255, 42, 116, 0.12);
}

.rail-link.active i {
    color: var(--cyan);
    filter: drop-shadow(0 0 6px rgba(77, 233, 255, 0.72));
}

.rail-link-secondary {
    padding-block: 9px;
}

.rail-link-secondary:hover:not(:disabled) {
    box-shadow: inset 2px 0 var(--cyan), 0 0 18px rgba(77, 233, 255, 0.08);
}

.rail-telemetry {
    margin-top: auto;
    padding-top: 22px;
    display: grid;
    gap: 10px;
}

.rail-mini-card,
.rail-deck {
    padding: 13px;
    background: rgba(8, 12, 23, 0.9);
    border: 1px solid rgba(102, 119, 149, 0.22);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.rail-mini-card-good {
    border-color: rgba(0, 245, 138, 0.22);
}

.rail-mini-value {
    margin-top: 8px;
    color: #e9eef7;
    font-family: "Rajdhani", sans-serif;
    font-size: 0.92rem;
    line-height: 1.35;
}

.rail-mini-meta {
    margin-top: 7px;
    color: #707a8f;
    font-size: 0.65rem;
    line-height: 1.55;
}

.rail-deck {
    position: relative;
    min-height: 142px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 42, 116, 0.08), rgba(5, 7, 15, 0.7)),
        url("/assets/dblbot-cyber-hero.png") 80% center / auto 150% no-repeat;
    border-color: rgba(255, 42, 116, 0.48);
}

.rail-deck::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(4, 6, 13, 0.88), rgba(4, 6, 13, 0.16));
}

.rail-deck > * {
    position: relative;
    z-index: 1;
}

.rail-deck > i {
    align-self: flex-end;
    margin-right: 12px;
    color: var(--pip-strong);
    font-size: 2.2rem;
    filter: drop-shadow(0 0 12px rgba(255, 42, 116, 0.55));
}

.rail-deck button {
    width: 100%;
    padding: 8px 9px;
    font-size: 0.66rem;
}

.rail-readout {
    padding: 14px;
    background: linear-gradient(145deg, rgba(77, 233, 255, 0.055), rgba(255, 42, 116, 0.04));
    border: 1px solid rgba(77, 233, 255, 0.18);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.rail-readout-label {
    color: var(--cyan);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.rail-readout-value {
    margin-top: 8px;
    color: var(--good);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.rail-version {
    margin: 14px 4px 0;
    color: #31384a;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.workspace {
    min-width: 0;
    padding: 22px 34px 38px;
}

.system-bar {
    min-height: 54px;
    margin: -22px -34px 16px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--cyan);
    background: rgba(4, 7, 15, 0.78);
    border-bottom: 1px solid rgba(255, 42, 116, 0.18);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.control-ident {
    display: grid;
    gap: 3px;
}

.control-ident strong {
    color: var(--cyan);
    font-family: "Rajdhani", sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.control-ident small {
    color: #567284;
    font-size: 0.54rem;
    letter-spacing: 0.12em;
}

.operator-cluster {
    display: flex;
    align-items: center;
    gap: 14px;
}

.system-clock {
    padding-right: 14px;
    display: grid;
    gap: 2px;
    text-align: right;
    border-right: 1px solid rgba(77, 233, 255, 0.15);
}

.system-clock strong {
    color: var(--cyan);
    font-family: "Rajdhani", sans-serif;
    font-size: 1rem;
    letter-spacing: 0.08em;
}

.system-clock small {
    color: #587485;
    font-size: 0.55rem;
}

.night-city {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c9d0dd;
    text-align: right;
    letter-spacing: 0.05em;
    text-transform: none;
}

.night-city > i {
    color: #aeb7c7;
}

.night-city span,
.operator-name {
    display: grid;
    gap: 2px;
}

.night-city small,
.operator-name small {
    color: #758094;
    font-size: 0.54rem;
    letter-spacing: 0.04em;
}

.operator-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    font-family: "Rajdhani", sans-serif;
    font-weight: 700;
    background:
        radial-gradient(circle at 35% 30%, rgba(77, 233, 255, 0.65), transparent 28%),
        linear-gradient(145deg, #451a4f, #101728);
    border: 1px solid var(--pip-strong);
    border-radius: 50%;
    box-shadow: 0 0 16px rgba(255, 42, 116, 0.25);
}

.operator-name strong {
    color: #eef5ff;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
}

.operator-menu {
    width: 32px;
    height: 32px;
    padding: 0;
    color: #9ca6b9;
    background: rgba(8, 12, 23, 0.8);
    border-color: rgba(104, 121, 151, 0.25);
}

.topbar {
    position: relative;
    min-height: 246px;
    margin: 0 0 18px;
    padding: 34px 30px 76px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(5, 7, 16, 0.98), rgba(5, 7, 16, 0.88) 38%, rgba(5, 7, 16, 0.08) 74%),
        url("/assets/dblbot-cyber-hero.png") center / cover no-repeat;
    border: 1px solid rgba(255, 42, 116, 0.62);
    box-shadow: inset 0 0 64px rgba(0, 0, 0, 0.48), var(--shadow);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(180deg, transparent 0 4px, rgba(255, 255, 255, 0.018) 4px 5px);
}

.topbar > div:first-child {
    position: relative;
    z-index: 1;
    width: min(620px, 66%);
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--pip-strong);
    font-weight: 700;
}

.eyebrow::before {
    content: "▮";
    margin-right: 7px;
    color: var(--cyan);
}

h1 {
    color: #f3f6fb;
    font-size: clamp(2.4rem, 5vw, 4.45rem);
    letter-spacing: 0.045em;
    text-shadow: 3px 3px rgba(255, 42, 116, 0.22);
}

.subtitle {
    max-width: 580px;
    color: #c3c9d5;
    font-family: "Rajdhani", sans-serif;
    font-size: 1.05rem;
}

.quick-links {
    position: absolute;
    z-index: 2;
    left: 30px;
    bottom: 22px;
}

.chip-link,
.pill {
    min-height: 35px;
    padding: 8px 12px;
    color: #e8edf7;
    background: rgba(6, 9, 18, 0.82);
    border-color: rgba(255, 42, 116, 0.46);
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

.chip-link:hover {
    color: #fff;
    border-color: var(--cyan);
    box-shadow: 0 0 18px rgba(77, 233, 255, 0.2);
}

.panel {
    min-height: 0;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(255, 42, 116, 0.035), transparent 38%),
        linear-gradient(180deg, rgba(11, 15, 28, 0.94), rgba(6, 9, 19, 0.97));
    border: 1px solid rgba(255, 42, 116, 0.34);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.025), 0 16px 48px rgba(0, 0, 0, 0.2);
    clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
}

.auth-panel {
    min-height: 0;
    transition: padding 180ms ease, opacity 180ms ease;
}

.session-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.session-panel-head h2 {
    margin-bottom: 12px;
}

.session-panel-head .auth-status {
    margin-top: 7px;
}

.operator-session-card {
    padding: 13px;
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto;
    align-items: center;
    gap: 14px;
    background:
        linear-gradient(90deg, rgba(145, 70, 255, 0.07), transparent 42%),
        rgba(3, 6, 14, 0.7);
    border: 1px solid rgba(145, 70, 255, 0.28);
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}

.session-link-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #b888ff;
    font-size: 1.05rem;
    background: rgba(145, 70, 255, 0.1);
    border: 1px solid rgba(174, 126, 255, 0.35);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.session-link-copy {
    display: grid;
    gap: 4px;
}

.session-link-copy strong {
    color: #f1eaff;
    font-family: "Rajdhani", sans-serif;
    font-size: 1rem;
    letter-spacing: 0.03em;
}

.session-link-copy span {
    color: #858fa3;
    font-size: 0.76rem;
    line-height: 1.45;
}

.session-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.session-actions > * {
    min-height: 38px;
}

.session-signout {
    color: #ff7aa5;
    border-color: rgba(255, 42, 116, 0.34);
}

body[data-dashboard-ready="true"] .auth-panel {
    padding: 17px 20px;
    border-color: rgba(0, 245, 138, 0.28);
}

body[data-dashboard-ready="true"] .auth-panel h2 {
    margin-bottom: 10px;
}

body[data-dashboard-ready="true"] .auth-panel .auth-row {
    min-height: 36px;
}

body[data-dashboard-ready="true"] .auth-panel .message {
    margin-top: 9px;
    padding-block: 8px;
}

body[data-dashboard-ready="true"] .auth-panel .auth-status {
    color: var(--good);
}

body[data-dashboard-ready="true"] .auth-panel .muted-note {
    margin-top: 8px;
}

body[data-dashboard-ready="true"] #dashboardContent {
    display: block !important;
}

.panel::before {
    background:
        linear-gradient(90deg, var(--pip) 0 42px, transparent 42px) top left / 100% 1px no-repeat,
        linear-gradient(135deg, rgba(77, 233, 255, 0.025), transparent 48%);
}

.panel h2,
.stat-label,
.section-label,
.field-label {
    color: var(--pip-strong);
}

.stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.stats .panel {
    min-height: 128px;
    overflow: hidden;
}

.stat-icon {
    position: absolute;
    right: 18px;
    bottom: 17px;
    color: rgba(255, 42, 116, 0.46);
    font-size: 1.65rem;
    filter: drop-shadow(0 0 9px rgba(255, 42, 116, 0.22));
}

.signal-trace {
    width: calc(100% - 56px);
    height: 22px;
    margin-top: 7px;
    opacity: 0.74;
    background:
        linear-gradient(90deg, rgba(0, 245, 138, 0.08), rgba(0, 245, 138, 0.6), rgba(0, 245, 138, 0.08)) center / 100% 1px no-repeat,
        linear-gradient(115deg, transparent 0 8%, #00f58a 8.5% 9%, transparent 9.5% 19%, #00f58a 19.5% 20.2%, transparent 20.8% 35%, #00f58a 35.5% 36.3%, transparent 37% 51%, #00f58a 51.5% 52.5%, transparent 53% 67%, #00f58a 67.5% 68.3%, transparent 69% 83%, #00f58a 83.5% 84.2%, transparent 85%);
    filter: drop-shadow(0 0 4px rgba(0, 245, 138, 0.42));
}

.stat-value {
    color: #f3f6fb;
    font-size: 1.75rem;
}

.status-good {
    color: var(--good);
    text-shadow: 0 0 18px rgba(0, 245, 138, 0.26);
}

.status-warn {
    color: #ffc857;
}

.status-bad,
.danger-button {
    color: var(--danger);
}

.stat-meta,
.muted-note,
.panel-copy,
.notification-meta,
.auth-status,
.save-status,
.custom-command-copy,
.timer-copy {
    color: var(--muted);
}

.panel-grid {
    grid-template-columns: minmax(0, 1.24fr) minmax(310px, 0.92fr);
}

input[type="password"],
input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
    color: #edf4ff;
    caret-color: var(--cyan);
    background: rgba(3, 6, 14, 0.9);
    border-color: rgba(105, 126, 158, 0.38);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(77, 233, 255, 0.72);
    box-shadow: 0 0 0 2px rgba(77, 233, 255, 0.08), 0 0 20px rgba(77, 233, 255, 0.08);
}

button {
    color: var(--cyan);
    background: linear-gradient(180deg, rgba(77, 233, 255, 0.1), rgba(13, 47, 63, 0.12));
    border-color: rgba(77, 233, 255, 0.42);
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

button i,
.chip-link i,
.panel h2 i {
    margin-right: 6px;
}

button:hover:not(:disabled) {
    border-color: var(--cyan);
    background: rgba(77, 233, 255, 0.15);
    box-shadow: 0 0 22px rgba(77, 233, 255, 0.15);
}

.secondary-button {
    color: var(--pip-strong);
    border-color: rgba(255, 42, 116, 0.38);
    background: rgba(255, 42, 116, 0.07);
}

.danger-button {
    border-color: rgba(255, 42, 116, 0.48);
    background: rgba(255, 42, 116, 0.08);
}

.message.success {
    color: var(--good);
    border-color: rgba(0, 245, 138, 0.3);
    background: rgba(0, 245, 138, 0.07);
}

.message.error {
    color: #ff779e;
    border-color: rgba(255, 42, 116, 0.4);
    background: rgba(255, 42, 116, 0.08);
}

.message.info {
    color: var(--cyan);
    border-color: rgba(77, 233, 255, 0.3);
    background: rgba(77, 233, 255, 0.06);
}

.tab-bar {
    gap: 0;
    margin-top: 22px;
    border-bottom: 1px solid rgba(255, 42, 116, 0.28);
}

.tab-button {
    margin-bottom: -1px;
    color: #8d96a8;
    background: rgba(7, 10, 20, 0.8);
    border-color: rgba(91, 105, 131, 0.28);
}

.tab-button.active {
    color: #fff;
    background: linear-gradient(180deg, rgba(255, 42, 116, 0.2), rgba(255, 42, 116, 0.04));
    border-color: rgba(255, 42, 116, 0.7);
    box-shadow: inset 0 -2px var(--pip);
}

.settings-tab-button {
    display: none;
}

.list {
    gap: 6px;
}

.list-item,
.notification-card {
    background: rgba(5, 8, 17, 0.8);
    border-color: rgba(88, 106, 137, 0.25);
}

.list-item:hover {
    border-color: rgba(255, 42, 116, 0.3);
    background: rgba(255, 42, 116, 0.035);
}

.list-item strong,
.notification-card h3 {
    color: #dfe8f7;
}

.command-badge,
.token-chip {
    color: var(--cyan);
    border-color: rgba(77, 233, 255, 0.24);
    background: rgba(77, 233, 255, 0.045);
}

.empty {
    color: #767f92;
    border-color: rgba(255, 42, 116, 0.24);
    background: rgba(3, 5, 12, 0.46);
}

code {
    color: var(--cyan);
}

.settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.settings-option {
    padding: 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid rgba(100, 118, 149, 0.18);
}

.settings-option > div {
    display: grid;
    gap: 5px;
}

.settings-option strong,
.settings-readout strong {
    color: #e7edf8;
    font-family: "Rajdhani", sans-serif;
}

.settings-option span {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.cyber-toggle {
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    height: 25px;
}

.cyber-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cyber-toggle span {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #090d18;
    border: 1px solid rgba(111, 130, 160, 0.38);
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}

.cyber-toggle span::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 5px;
    width: 15px;
    height: 15px;
    background: #687287;
    transition: transform 150ms ease, background 150ms ease;
}

.cyber-toggle input:checked + span {
    border-color: rgba(77, 233, 255, 0.64);
    background: rgba(77, 233, 255, 0.08);
}

.cyber-toggle input:checked + span::after {
    background: var(--cyan);
    box-shadow: 0 0 10px rgba(77, 233, 255, 0.55);
    transform: translateX(21px);
}

.settings-readout {
    display: grid;
    grid-template-columns: minmax(110px, 0.55fr) 1fr;
    gap: 0;
    border: 1px solid rgba(92, 109, 140, 0.22);
}

.settings-readout > * {
    padding: 11px 13px;
    border-bottom: 1px solid rgba(92, 109, 140, 0.16);
}

.settings-readout > :nth-last-child(-n + 2) {
    border-bottom: 0;
}

.settings-readout span {
    color: var(--cyan);
    background: rgba(77, 233, 255, 0.035);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.settings-modules {
    grid-column: 1 / -1;
}

.settings-module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.settings-module-grid button {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.settings-module-grid button > i {
    margin: 0;
    font-size: 1.25rem;
}

.settings-module-grid button > span {
    display: grid;
    gap: 3px;
}

.settings-module-grid strong {
    color: #e9eff9;
    font-family: "Rajdhani", sans-serif;
    font-size: 1rem;
}

.settings-module-grid small {
    color: #727d91;
    font-size: 0.66rem;
}

body.reduce-effects::before,
body.reduce-effects::after {
    display: none;
}

body.reduce-effects .signal-trace {
    opacity: 0.3;
    filter: none;
}

body.reduce-effects *,
body.reduce-effects *::before,
body.reduce-effects *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
}

body.dense-mode .list {
    gap: 3px;
}

body.dense-mode .list-item {
    padding-block: 7px;
}

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

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

    .workspace {
        padding-inline: 24px;
    }

    .system-bar {
        margin-inline: -24px;
        padding-inline: 24px;
    }
}

@media (max-width: 960px) {
    .shell {
        width: 100%;
        padding: 0;
        grid-template-columns: 1fr;
    }

    .side-rail {
        position: relative;
        min-height: auto;
        height: auto;
        padding: 14px 18px;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 12px 24px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 42, 116, 0.32);
    }

    .brand {
        padding: 0;
        border: 0;
    }

    .brand-mark {
        font-size: 1.5rem;
    }

    .brand-sub,
    .rail-label,
    .rail-system-group,
    .rail-telemetry,
    .rail-readout,
    .rail-version {
        display: none;
    }

    .rail-group {
        margin: 0;
        align-self: center;
    }

    .rail-nav {
        display: flex;
        justify-content: flex-end;
        overflow-x: auto;
    }

    .rail-link {
        width: auto;
        min-width: max-content;
        padding: 9px 10px;
    }

    .panel-grid,
    .custom-command-layout,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-tab-button {
        display: inline-flex;
    }

    .operator-session-card {
        grid-template-columns: auto 1fr;
    }

    .session-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .settings-modules {
        grid-column: auto;
    }
}

@media (max-width: 700px) {
    .side-rail {
        grid-template-columns: 1fr;
    }

    .rail-nav {
        justify-content: flex-start;
    }

    .workspace {
        padding: 14px;
    }

    .system-bar {
        min-height: 46px;
        margin: -14px -14px 14px;
        padding: 0 14px;
    }

    .control-ident,
    .night-city {
        display: none;
    }

    .topbar {
        min-height: 310px;
        padding: 24px 20px 96px;
        background-position: 64% center;
    }

    .topbar > div:first-child {
        width: 100%;
    }

    .quick-links {
        left: 20px;
        right: 20px;
        bottom: 18px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .quick-links > * {
        min-width: max-content;
    }

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

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

    .session-panel-head {
        display: grid;
    }

    .session-panel-head .auth-status {
        margin-top: -8px;
    }

    .operator-session-card {
        grid-template-columns: 1fr;
    }

    .session-link-icon {
        display: none;
    }

    .session-actions {
        grid-column: auto;
        display: grid;
    }

    .stats .panel {
        min-height: auto;
    }

    .tab-bar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .tab-button {
        width: auto;
        min-width: max-content;
    }
}
