:root {
    --bg: #0b1120;
    --panel: #111827;
    --panel-soft: #162033;
    --text: #dbe7f6;
    --muted: #8ea0b8;
    --line: #263348;
    --line-soft: #1f2b3f;
    --green: #34d399;
    --green-soft: rgba(52, 211, 153, 0.13);
    --red: #fb7185;
    --red-soft: rgba(251, 113, 133, 0.13);
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, 0.14);
    --blue: #60a5fa;
    --blue-soft: rgba(96, 165, 250, 0.14);
    --teal: #2dd4bf;
    --ink: #f8fbff;
    --shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 28rem),
        radial-gradient(circle at top right, rgba(45, 212, 191, 0.12), transparent 24rem),
        linear-gradient(180deg, #0f172a 0%, var(--bg) 34rem);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
}

.app-shell {
    width: min(1540px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -18px -18px 16px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(217, 225, 236, 0.86);
    background: rgba(11, 17, 32, 0.9);
    backdrop-filter: blur(14px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 0 0 auto;
}

.brand-logo {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(23, 92, 211, 0.22);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(24px, 3.2vw, 34px);
    line-height: 1.05;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.88);
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
}

.interval-control {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

select,
button {
    font: inherit;
}

select {
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 0 34px 0 12px;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--text);
    cursor: pointer;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    text-decoration: none;
}

.text-button[aria-pressed="true"] {
    border-color: rgba(96, 165, 250, 0.45);
    background: var(--blue-soft);
    color: var(--blue);
}

.text-button:hover {
    border-color: var(--blue);
}

.icon-button:hover,
select:hover {
    border-color: var(--blue);
}

.summary-grid,
.server-grid {
    display: grid;
    gap: 12px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
}

.dashboard-layout.is-sidebar-hidden {
    grid-template-columns: minmax(0, 1fr);
}

.dashboard-layout.is-sidebar-hidden .sidebar {
    display: none;
}

.dashboard-content {
    min-width: 0;
}

.sidebar-toggle {
    display: inline-flex;
    grid-column: 1 / -1;
    width: fit-content;
}

.sidebar {
    position: sticky;
    top: 88px;
    overflow: hidden;
}

.sidebar-head {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-soft);
}

.sidebar-head strong {
    display: block;
    color: var(--ink);
    font-size: 17px;
    line-height: 1.2;
}

.sidebar-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    margin-top: 12px;
    padding: 0 10px;
    border: 1px solid rgba(52, 211, 153, 0.34);
    border-radius: 8px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 18px;
    font-weight: 900;
}

.sidebar-add {
    width: 100%;
    margin-top: 10px;
}

.server-menu {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.server-menu-item {
    position: relative;
    display: grid;
    gap: 8px;
    min-height: 116px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.server-menu-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 8px 0 0 8px;
    background: transparent;
}

.server-menu-item:hover,
.server-menu-item.is-active {
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(96, 165, 250, 0.1);
}

.server-menu-item.is-active::before {
    background: var(--blue);
}

.server-menu-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.server-menu-kicker,
.server-menu-address {
    grid-column: 1;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.server-menu-item strong {
    grid-column: 1;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.server-menu-location {
    grid-column: 1;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(45, 212, 191, 0.45);
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.13);
    color: var(--teal);
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.22), inset 0 0 10px rgba(45, 212, 191, 0.08);
    text-shadow: 0 0 10px rgba(45, 212, 191, 0.55);
}

.server-menu-address {
    overflow-wrap: anywhere;
}

.server-menu-address.is-hidden {
    color: #64748b;
    font-style: italic;
}

.server-menu-status {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    min-width: 58px;
    padding: 4px 8px;
    border-radius: 999px;
    text-align: center;
    font-size: 10px;
    font-weight: 900;
}

.server-menu-status.online {
    background: var(--green-soft);
    color: var(--green);
}

.server-menu-status.offline {
    background: var(--red-soft);
    color: var(--red);
}

.server-menu-status.paused {
    background: var(--amber-soft);
    color: var(--amber);
}

.server-menu-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.server-menu-actions button {
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
}

.server-menu-actions button:hover {
    border-color: var(--blue);
}

.server-menu-actions button[data-toggle-monitoring] {
    border-color: rgba(251, 191, 36, 0.5);
    background: var(--amber-soft);
    color: var(--amber);
}

.server-menu-actions button[data-toggle-monitoring][data-monitoring-enabled="1"] {
    border-color: rgba(52, 211, 153, 0.5);
    background: var(--green-soft);
    color: var(--green);
}

.server-menu-actions button[data-toggle-monitoring]:hover {
    filter: brightness(1.12);
}

.server-menu-actions button[data-delete-server]:hover {
    border-color: rgba(251, 113, 133, 0.55);
    color: var(--red);
}

.sidebar-empty {
    padding: 14px;
    color: var(--muted);
    font-weight: 800;
}

.summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 12px;
}

.summary-grid[hidden] {
    display: none;
}

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

.card {
    background: rgba(17, 24, 39, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.07);
}

.summary-card {
    position: relative;
    min-height: 94px;
    padding: 14px 14px 14px 16px;
    overflow: hidden;
}

.summary-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--blue);
}

.summary-card:nth-child(2)::before {
    background: var(--green);
}

.summary-card:nth-child(3)::before {
    background: var(--teal);
}

.summary-card:nth-child(4)::before {
    background: var(--amber);
}

.summary-card:nth-child(5)::before {
    background: var(--red);
}

.monitoring-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.monitoring-summary-card {
    position: relative;
    min-height: 94px;
    padding: 14px 14px 14px 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.monitoring-summary-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--blue);
}

.monitoring-summary-card:nth-child(2)::before {
    background: var(--green);
}

.monitoring-summary-card:nth-child(3)::before {
    background: var(--teal);
}

.monitoring-summary-card:nth-child(4)::before {
    background: var(--amber);
}

.monitoring-summary-card .label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.monitoring-summary-card .value {
    margin-top: 8px;
    color: var(--ink);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.monitoring-summary-card .detail {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
}

.alert-panel {
    min-width: 0;
}

.header-alert {
    flex: 1 1 auto;
    max-width: 480px;
    margin-left: auto;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.72);
}

.alert-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.alert-head h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 13px;
}

.alert-head span {
    color: var(--muted);
    font-size: 11px;
}

.alert-count {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.alert-count:hover {
    filter: brightness(1.12);
}

.alert-count.good {
    background: var(--green-soft);
    color: var(--green);
}

.alert-count.warn {
    background: var(--amber-soft);
    color: var(--amber);
}

.alert-count.bad {
    background: var(--red-soft);
    color: var(--red);
}

.alert-warn span {
    background: var(--amber-soft);
    color: var(--amber);
}

.alert-bad span {
    background: var(--red-soft);
    color: var(--red);
}

.summary-card .label,
.metric .label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.summary-card .value {
    margin-top: 8px;
    color: var(--ink);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.summary-card .detail {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
}

.server-card {
    overflow: hidden;
}

.server-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(22, 32, 51, 0.92) 0%, rgba(17, 24, 39, 0.92) 100%);
}

.server-head.compact {
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.server-head-title {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.server-title h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.2;
}

.server-location {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-bottom: 5px;
    padding: 0 8px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 11px;
    font-weight: 900;
}

.server-address {
    color: var(--muted);
    font-size: 12px;
}

.server-address.is-hidden {
    color: #64748b;
    font-style: italic;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 26px;
    border-radius: 999px;
    padding: 0 12px;
    font-size: 10px;
    font-weight: 900;
}

.badge.online {
    background: var(--green-soft);
    color: var(--green);
}

.badge.offline {
    background: var(--red-soft);
    color: var(--red);
}

.badge.paused {
    background: var(--amber-soft);
    color: var(--amber);
}

.server-body {
    padding: 14px;
}

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

.metric {
    min-height: 92px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.server-tabs {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.server-tabs button {
    min-width: 118px;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.server-tabs button:hover {
    color: var(--text);
}

.server-tabs button.is-active {
    border-color: rgba(96, 165, 250, 0.45);
    background: var(--blue-soft);
    color: var(--blue);
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.metric-top span {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 9px;
    font-weight: 900;
}

.metric-good .metric-top span {
    background: var(--green-soft);
    color: var(--green);
}

.metric-warn .metric-top span {
    background: var(--amber-soft);
    color: var(--amber);
}

.metric-bad .metric-top span {
    background: var(--red-soft);
    color: var(--red);
}

.metric .value {
    margin-top: 8px;
    color: var(--ink);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.metric-good .value {
    color: var(--green);
}

.metric-warn .value {
    color: var(--amber);
}

.metric-bad .value {
    color: var(--red);
}

.metric-neutral .value {
    color: var(--blue);
}

.metric .hint {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.meter {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #22304a;
    margin-top: 9px;
}

.meter-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
    transition: width 180ms ease;
}

.meter-fill.warning {
    background: var(--amber);
}

.meter-fill.danger {
    background: var(--red);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 16px 0 8px;
    border: 0;
    background: transparent;
    color: #a4b3c7;
    font-size: 11px;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
}

.section-title::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--blue);
}

.section-toggle {
    min-height: 36px;
    padding: 0;
    cursor: pointer;
}

.section-toggle span {
    flex: 0 1 auto;
}

.section-toggle em {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: none;
}

.section-toggle i {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(96, 165, 250, 0.36);
    border-radius: 7px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 15px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
}

.section-toggle:hover i {
    border-color: var(--blue);
    background: rgba(96, 165, 250, 0.22);
}

.collapsible-section.is-closed {
    border-bottom: 1px solid var(--line-soft);
}

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

.trend-card {
    min-height: 132px;
    padding: 11px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.trend-top,
.trend-range {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.trend-top span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.trend-top strong {
    color: var(--ink);
    font-size: 15px;
    line-height: 1;
}

.sparkline {
    display: block;
    width: 100%;
    height: 54px;
    margin: 10px 0 8px;
    border-bottom: 1px solid var(--line);
}

.sparkline polyline {
    fill: none;
    stroke: var(--teal);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.sparkline-empty {
    display: grid;
    place-items: center;
    height: 72px;
    margin: 8px 0;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.trend-range {
    color: var(--muted);
    font-size: 10px;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
}

th,
td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
    vertical-align: top;
}

th {
    position: sticky;
    top: 0;
    color: #a4b3c7;
    background: #162033;
    font-size: 11px;
    font-weight: 900;
}

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

td code {
    color: #c7d7ee;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.process-detail-table table {
    min-width: 980px;
}

.process-kill-button {
    min-width: 58px;
    height: 30px;
    border: 1px solid rgba(251, 113, 133, 0.58);
    border-radius: 7px;
    background: rgba(251, 113, 133, 0.14);
    color: var(--red);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
}

.process-kill-button:hover {
    background: rgba(251, 113, 133, 0.24);
}

.process-kill-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.process-message {
    margin: -2px 0 8px;
    padding: 9px 10px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: 8px;
    background: rgba(52, 211, 153, 0.09);
    color: var(--green);
    font-size: 12px;
}

.process-message.is-error {
    border-color: rgba(251, 113, 133, 0.36);
    background: var(--red-soft);
    color: var(--red);
}

.slow-log-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.slow-log-meta > span {
    min-height: 50px;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.slow-log-meta strong {
    display: block;
    margin-top: 5px;
    color: var(--text);
    font-size: 12px;
}

.slow-threshold-control {
    position: relative;
    display: grid;
    gap: 5px;
}

.slow-threshold-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.slow-threshold-head span {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
}

.slow-threshold-head button {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(96, 165, 250, 0.36);
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.slow-threshold-head button:hover {
    border-color: var(--blue);
    background: rgba(96, 165, 250, 0.22);
}

.slow-threshold-control select {
    width: 100%;
    height: 28px;
    padding-left: 8px;
    font-size: 12px;
    font-weight: 800;
}

.floating-help {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    width: min(310px, 78vw);
    padding: 12px;
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-radius: 8px;
    background: #0f172a;
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 12px;
    line-height: 1.45;
}

.floating-help strong {
    margin: 0 0 6px;
    color: var(--ink);
}

.floating-help p {
    margin: 6px 0 0;
}

.notice-box {
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 8px;
    background: var(--amber-soft);
    color: var(--amber);
    font-size: 12px;
    line-height: 1.45;
}

.notice-box.is-success {
    border-color: rgba(52, 211, 153, 0.28);
    background: var(--green-soft);
    color: var(--green);
}

.notice-box.is-error {
    border-color: rgba(251, 113, 133, 0.36);
    background: var(--red-soft);
    color: var(--red);
}

.query-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.query-editor-wrap {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #0b1220;
}

.query-editor-gutter {
    overflow: auto;
    border-right: 1px solid var(--line-soft);
    background: #0a1528;
    color: #5f7390;
    font: 12px/1.55 "Cascadia Code", Consolas, monospace;
    padding: 12px 8px;
    text-align: right;
    user-select: none;
}

.query-editor-gutter span {
    display: block;
    min-height: calc(12px * 1.55);
}

.query-context {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.query-context-db {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 320px;
}

.query-context label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.query-context select {
    width: min(280px, 100%);
}

.query-workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}

.query-main {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: stretch;
    gap: 10px;
    min-width: 0;
}

.query-context-actions {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
}

.query-object-sidebar {
    height: clamp(420px, calc(100vh - 250px), 720px);
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0b1220;
}

.query-scrollbar {
    scrollbar-color: rgba(96, 165, 250, 0.48) rgba(15, 23, 42, 0.78);
    scrollbar-width: thin;
}

.query-scrollbar::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.query-scrollbar::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
}

.query-scrollbar::-webkit-scrollbar-thumb {
    border: 2px solid rgba(15, 23, 42, 0.78);
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.52);
}

.query-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.72);
}

.query-object-head,
.query-object-empty {
    padding: 9px 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.query-object-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: grid;
    gap: 8px;
    border-bottom: 1px solid var(--line-soft);
    background: #0b1220;
    color: var(--ink);
}

.query-object-head input {
    width: 100%;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 0 10px;
    font-size: 12px;
    outline: none;
    text-transform: none;
}

.query-object-head input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14);
}

.query-add-table {
    width: 100%;
    min-height: 32px;
}

.query-object-group {
    border-bottom: 1px solid var(--line-soft);
}

.query-object-group:last-child {
    border-bottom: 0;
}

.query-object-group-head {
    position: sticky;
    top: 75px;
    z-index: 1;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    background: #101a2d;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.query-object-group-head:hover {
    background: rgba(96, 165, 250, 0.12);
}

.query-object-group-head span {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 5px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
}

.query-object-group-head strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.query-object-group-head em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.query-object-group button:not(.query-object-group-head) {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.query-object-group button:not(.query-object-group-head):hover {
    background: var(--blue-soft);
}

.query-object-group button:not(.query-object-group-head) span {
    color: var(--blue);
    font-size: 10px;
    font-weight: 900;
}

.query-object-group button:not(.query-object-group-head) strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.query-object-table-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 66px;
    align-items: stretch;
    gap: 6px;
    padding: 4px 8px;
}

.query-object-table-item > button:not(.query-object-design) {
    padding: 7px 8px;
}

.query-object-design {
    min-height: 34px;
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 8px;
    background: var(--blue-soft);
    color: var(--blue);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
}

.query-object-design:hover {
    border-color: var(--blue);
    background: rgba(96, 165, 250, 0.24);
}

.query-editor {
    width: 100%;
    min-height: 0;
    height: 100%;
    max-height: none;
    resize: vertical;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font: 12px/1.55 "Cascadia Code", Consolas, monospace;
    padding: 12px;
    outline: none;
}

.query-editor:focus {
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45);
}

.autocomplete-panel {
    position: absolute;
    left: 10px;
    right: auto;
    top: 10px;
    z-index: 5;
    width: min(420px, calc(100% - 20px));
    max-height: 240px;
    overflow: auto;
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 8px;
    background: #0f172a;
    box-shadow: var(--shadow);
}

.autocomplete-panel[hidden] {
    display: none;
}

.autocomplete-panel button {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.autocomplete-panel button:last-child {
    border-bottom: 0;
}

.autocomplete-panel button:hover {
    background: var(--blue-soft);
}

.autocomplete-panel span {
    color: var(--blue);
    font-size: 10px;
    font-weight: 900;
}

.autocomplete-panel strong {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.query-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 0 2px;
}

.query-action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.query-actions span,
.query-meta,
.query-empty {
    color: var(--muted);
    font-size: 12px;
}

.query-actions strong {
    color: var(--ink);
}

.query-run {
    min-width: 74px;
    min-height: 34px;
    height: 34px;
    padding: 0 10px;
}

.query-refresh {
    min-height: 34px;
    height: 34px;
}

.query-design:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.query-run:disabled {
    cursor: wait;
    opacity: 0.72;
}

.query-result {
    display: grid;
    gap: 8px;
}

.query-inline-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
}

.query-inline-state.is-success {
    border-color: rgba(52, 211, 153, 0.34);
    background: rgba(52, 211, 153, 0.09);
    color: var(--green);
}

.query-inline-state.is-error {
    border-color: rgba(251, 113, 133, 0.36);
    background: var(--red-soft);
    color: var(--red);
}

.query-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.query-export-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.query-export {
    min-height: 34px;
    white-space: nowrap;
}

.query-success {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 8px;
    background: var(--green-soft);
}

.query-success strong {
    color: var(--green);
}

.query-success span {
    color: var(--text);
    font-size: 12px;
}

.query-table table {
    min-width: 620px;
}

.query-table {
    height: clamp(420px, calc(100vh - 250px), 720px);
}

.query-table td {
    max-width: 360px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.query-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.query-pagination div {
    display: flex;
    gap: 8px;
}

.query-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.buffer-panel {
    display: grid;
    gap: 12px;
}

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

.buffer-chart {
    min-height: 214px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.buffer-chart h3 {
    margin: 0 0 12px;
    text-align: center;
    font-size: 13px;
}

.bar-chart {
    display: grid;
    gap: 12px;
    padding-top: 10px;
}

.bar-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) 96px;
    align-items: center;
    gap: 12px;
    min-height: 34px;
    font-size: 12px;
}

.bar-row span {
    color: var(--muted);
}

.bar-row strong {
    text-align: right;
    overflow-wrap: anywhere;
}

.bar-track {
    height: 24px;
    border-left: 1px solid var(--line);
    background: repeating-linear-gradient(
        to right,
        transparent 0,
        transparent calc(25% - 1px),
        #25344d 25%
    );
}

.bar-fill {
    height: 100%;
    min-width: 2px;
    border-radius: 2px;
}

.bar-fill.disk {
    background: #e66a8d;
}

.bar-fill.request {
    background: #13a3c7;
}

.donut-wrap {
    display: grid;
    place-items: center;
    gap: 12px;
}

.donut {
    width: min(178px, 100%);
    height: auto;
}

.donut circle {
    fill: none;
    stroke-width: 16;
}

.donut-free {
    stroke: #14b8a6;
}

.donut-used {
    stroke: #f8bd4b;
    transition: stroke-dasharray 180ms ease;
}

.donut text:first-of-type {
    fill: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.donut text:last-of-type {
    fill: var(--muted);
    font-size: 7px;
    font-weight: 800;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    color: var(--muted);
    font-size: 11px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend i {
    width: 22px;
    height: 9px;
    display: inline-block;
    border-radius: 999px;
}

.legend .used {
    background: #f8bd4b;
}

.legend .free {
    background: #14b8a6;
}

.analysis-box {
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.analysis-box strong {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
}

.analysis-box p {
    display: flex;
    gap: 8px;
    margin: 7px 0;
    color: var(--text);
    font-size: 12px;
    line-height: 1.42;
}

.analysis-box p::before {
    content: "OK";
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 16px;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
}

.error-box {
    padding: 12px;
    border: 1px solid rgba(251, 113, 133, 0.35);
    border-radius: 8px;
    background: var(--red-soft);
    color: var(--red);
    overflow-wrap: anywhere;
}

body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(6px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-dialog {
    width: min(760px, 100%);
    max-height: min(720px, calc(100vh - 36px));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-soft);
}

.modal-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
}

.modal-close {
    background: var(--panel);
}

.modal-body {
    max-height: calc(100vh - 150px);
    overflow: auto;
    padding: 16px;
}

.server-dialog {
    width: min(620px, 100%);
}

.confirm-dialog {
    width: min(460px, 100%);
}

.table-designer-dialog {
    width: min(1200px, 100%);
}

.query-result-dialog {
    width: min(1460px, 98vw);
    height: min(88vh, 920px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.query-result-dialog .modal-body {
    max-height: none;
    min-height: 0;
    overflow: hidden;
    display: grid;
}

.query-result-dialog .query-table {
    height: 100%;
    min-height: 0;
}

.query-result-dialog .query-result {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.designer-panel {
    display: grid;
    gap: 12px;
}

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

.designer-meta .field input[disabled] {
    opacity: 0.8;
}

.designer-table-wrap {
    max-height: 62vh;
}

.designer-table {
    min-width: 1040px;
}

.designer-table td {
    padding: 8px;
}

.designer-table td input[type="text"] {
    width: 100%;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--text);
    font: inherit;
    padding: 0 10px;
    outline: none;
}

.designer-table td input[type="text"]:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14);
}

.designer-center {
    text-align: center;
}

.designer-center input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #60a5fa;
    cursor: pointer;
}

.designer-delete {
    min-height: 34px;
}

.designer-actions {
    display: flex;
    justify-content: flex-start;
}

.confirm-box {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(251, 113, 133, 0.35);
    border-radius: 8px;
    background: var(--red-soft);
}

.confirm-box strong {
    color: var(--ink);
    font-size: 17px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.confirm-box p {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
}

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

.server-form-grid .form-error {
    grid-column: 1 / -1;
}

.form-error {
    padding: 10px 12px;
    border: 1px solid rgba(251, 113, 133, 0.35);
    border-radius: 8px;
    background: var(--red-soft);
    color: var(--red);
    line-height: 1.45;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    background: var(--panel-soft);
}

.server-save {
    min-width: 110px;
    padding: 0 16px;
}

.danger-button {
    min-width: 110px;
    height: 42px;
    border: 1px solid rgba(251, 113, 133, 0.58);
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.danger-button:hover {
    filter: brightness(1.06);
}

.danger-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.modal-empty {
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.modal-empty strong {
    display: block;
    color: var(--green);
    font-size: 16px;
}

.modal-empty p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.modal-alert-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.modal-alert-summary span {
    min-height: 58px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
}

.modal-alert-summary strong {
    display: block;
    margin-top: 6px;
    color: var(--ink);
    font-size: 20px;
}

.modal-alert-list {
    display: grid;
    gap: 10px;
}

.modal-alert-item {
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.modal-alert-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.modal-alert-top span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.modal-alert-top strong {
    color: var(--muted);
    font-size: 12px;
}

.modal-alert-item h3 {
    margin: 10px 0 6px;
    color: var(--ink);
    font-size: 15px;
}

.modal-alert-item p {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 18px;
}

.login-shell {
    width: min(430px, 100%);
}

.login-card {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.login-brand h1 {
    font-size: 24px;
}

.field {
    display: grid;
    gap: 7px;
}

.field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.field input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 0 12px;
    outline: none;
}

.field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14);
}

.login-button {
    height: 42px;
    border: 1px solid rgba(96, 165, 250, 0.55);
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
}

.login-button:hover {
    filter: brightness(1.06);
}

.explain-panel {
    margin-top: 12px;
    padding: 14px;
}

.explain-panel h2 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: 16px;
}

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

.explain-grid div {
    min-height: 92px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.explain-grid strong,
.explain-grid span {
    display: block;
}

.explain-grid strong {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 13px;
}

.explain-grid span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    padding: 10px 2px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1200px) {
    .dashboard-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (max-width: 1080px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

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

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

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

    .header-alert {
        max-width: 360px;
    }

    .buffer-visuals {
        grid-template-columns: 1fr;
    }

    .query-workspace {
        grid-template-columns: 1fr;
    }

    .designer-meta {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 720px) {
    body {
        background: var(--bg);
    }

    .app-shell {
        padding: 14px;
    }

    .topbar {
        position: static;
        align-items: stretch;
        flex-direction: column;
        margin: -14px -14px 14px;
        padding: 18px 14px;
    }

    .header-alert {
        max-width: none;
        margin-left: 0;
    }

    h1 {
        font-size: 30px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .interval-control {
        flex: 1;
        justify-content: center;
    }

    select {
        min-width: 92px;
    }

    .sidebar-toggle {
        display: flex;
        width: 100%;
        margin-bottom: 10px;
    }

    .sidebar {
        display: none;
        margin-bottom: 12px;
    }

    .dashboard-layout.is-sidebar-open .sidebar {
        display: block;
    }

    .summary-grid,
    .monitoring-summary,
    .server-menu,
    .server-form-grid,
    .metrics-grid,
    .trend-grid,
    .explain-grid {
        grid-template-columns: 1fr;
    }

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

    .server-tabs button {
        min-width: 0;
    }

    .summary-card {
        min-height: 108px;
    }

    .server-head {
        padding: 16px;
    }

    .server-body {
        padding: 16px;
    }

    .metric {
        min-height: 104px;
    }

    .slow-log-meta {
        grid-template-columns: 1fr;
    }

    .bar-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .bar-row strong {
        text-align: left;
    }

    .footer {
        align-items: stretch;
        flex-direction: column;
    }

    .query-actions,
    .query-action-buttons,
    .query-export-buttons,
    .query-result-head,
    .query-success {
        align-items: stretch;
        flex-direction: column;
    }

    .query-run,
    .query-export {
        width: 100%;
    }

    .query-context {
        align-items: stretch;
        flex-direction: column;
    }

    .query-context-db {
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .query-context select {
        width: 100%;
    }

    .query-object-sidebar,
    .query-table {
        height: 360px;
    }

    .query-editor-wrap {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .query-object-sidebar {
        min-height: 420px;
    }

    .query-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .query-pagination div {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .query-inline-state {
        align-items: stretch;
        flex-direction: column;
    }

    .autocomplete-panel button {
        grid-template-columns: 78px minmax(0, 1fr);
    }

    .query-object-table-item {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 6px 8px;
    }

    .query-object-design {
        min-height: 30px;
    }

    .modal-alert-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .app-shell {
        padding: 10px;
    }

    .topbar {
        margin: -10px -10px 12px;
        padding: 16px 10px;
    }

    h1 {
        font-size: 26px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
    }

    .server-head {
        align-items: stretch;
        flex-direction: column;
    }

    .badge {
        width: 100%;
    }

    .summary-card .value {
        font-size: 30px;
    }

    table {
        min-width: 560px;
    }
}
