:root {
  color-scheme: dark;
  --bg: #090b0f;
  --bg-2: #0c0f14;
  --surface: #11151b;
  --surface-2: #171c24;
  --surface-3: #1d232d;
  --line: #29313c;
  --line-soft: #1d242d;
  --text: #f4f6fa;
  --muted: #8d97a6;
  --faint: #596372;
  --primary: #5865f2;
  --primary-2: #7180ff;
  --green: #38d996;
  --yellow: #f6b94b;
  --red: #ff667a;
  --shadow: 0 22px 60px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.icon { width: 17px; height: 17px; display: inline-flex; flex: 0 0 auto; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-frame { min-height: 100vh; }
.topbar {
  height: 68px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9,11,15,.94);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--text);
  color: #0b0e13;
  font-weight: 950;
  letter-spacing: -.08em;
  clip-path: polygon(0 0, 78% 0, 100% 22%, 100% 100%, 0 100%);
}
.brand-copy { display: grid; line-height: 1; gap: 4px; }
.brand-copy b { font-size: 14px; letter-spacing: .12em; }
.brand-copy small { color: var(--muted); font-size: 9px; letter-spacing: .18em; font-weight: 800; }
.global-status {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 7px 11px;
  border: 1px solid var(--line-soft);
  background: #0d1116;
}
.status-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.global-status.online .status-pulse { background: var(--green); box-shadow: 0 0 0 4px rgba(56,217,150,.08); }
.global-status.warning .status-pulse { background: var(--yellow); }
.user-area { justify-self: end; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-avatar { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; background: var(--surface-2); }
.user-avatar-fallback { display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.user-chip > span { display: grid; gap: 2px; }
.user-chip > span b { font-size: 12px; }
.user-chip > span small { color: var(--muted); font-size: 10px; }
.topbar-button { margin-left: 5px; padding: 7px 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
.topbar-button:hover { color: var(--text); }

.main-shell { width: min(1420px, calc(100% - 56px)); margin: 0 auto; }
.login-screen { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1.2fr .8fr; gap: 80px; align-items: center; }
.overline { color: var(--primary-2); font-size: 10px; font-weight: 900; letter-spacing: .2em; }
.login-copy h1, .page-head h1 { margin: 10px 0 14px; letter-spacing: -.055em; }
.login-copy h1 { font-size: clamp(62px, 7vw, 112px); line-height: .84; max-width: 850px; }
.login-copy p { color: var(--muted); max-width: 620px; line-height: 1.7; font-size: 16px; margin: 0 0 28px; }
.login-console { justify-self: end; width: min(430px,100%); background: #0d1116; border: 1px solid var(--line); box-shadow: var(--shadow); }
.console-top, .console-line, .console-foot { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.console-top span, .console-foot { color: var(--muted); font-size: 10px; letter-spacing: .14em; font-weight: 800; }
.console-top b { color: var(--green); font-size: 10px; letter-spacing: .14em; }
.console-line span { color: var(--muted); font-size: 12px; }
.console-line strong { font-size: 11px; letter-spacing: .08em; }
.console-foot { border-bottom: 0; justify-content: flex-start; }

.button { min-height: 39px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 800; font-size: 12px; transition: border-color .14s ease, background .14s ease, transform .14s ease; }
.button:hover:not(:disabled) { border-color: #455161; background: var(--surface-3); transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { background: var(--primary); border-color: var(--primary); color: white; }
.button-primary:hover:not(:disabled) { background: var(--primary-2); border-color: var(--primary-2); }
.button-primary.dirty { box-shadow: 0 0 0 3px rgba(88,101,242,.12); }
.button-ghost { background: transparent; }
.button-large { min-height: 48px; padding: 0 20px; font-size: 13px; }

.server-screen { padding: 58px 0 90px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.page-head h1 { font-size: 52px; line-height: 1; }
.page-head p { color: var(--muted); margin: 0; font-size: 14px; }
.deck-stats { display: flex; border: 1px solid var(--line); background: #0d1116; }
.deck-stats div { min-width: 108px; padding: 13px 16px; display: grid; gap: 2px; border-left: 1px solid var(--line-soft); }
.deck-stats div:first-child { border-left: 0; }
.deck-stats b { font-size: 19px; }
.deck-stats span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.server-toolbar { margin-top: 34px; display: flex; justify-content: space-between; gap: 14px; }
.search-field { width: min(420px, 100%); height: 42px; border: 1px solid var(--line); background: #0d1116; display: flex; align-items: center; gap: 10px; padding: 0 13px; }
.search-field:focus-within { border-color: #4c5a6d; }
.search-icon { color: var(--faint); font-size: 19px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-field input::placeholder { color: #626d7b; }
.segmented-control { display: flex; border: 1px solid var(--line); background: #0d1116; padding: 3px; }
.segmented-control button { min-height: 34px; padding: 0 13px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 800; }
.segmented-control button.active { background: var(--surface-2); color: var(--text); }

.server-card-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.server-card {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.server-card::before { content: ''; position: absolute; left: 0; top: 0; width: 68px; height: 2px; background: var(--faint); }
.server-card.connected::before { background: var(--primary-2); }
.server-card:hover { transform: translateY(-3px); border-color: #465264; background: #131820; }
.server-card-topline { height: 38px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.server-card-topline span, .server-card-topline b { font-size: 9px; letter-spacing: .13em; font-weight: 900; }
.server-card-topline span { color: var(--muted); }
.server-card-topline b { color: var(--faint); }
.server-card.connected .server-card-topline b { color: var(--green); }
.server-card-main { padding: 22px 18px 18px; display: flex; gap: 14px; align-items: center; min-width: 0; }
.server-icon-wrap { position: relative; flex: 0 0 auto; }
.server-icon { width: 62px; height: 62px; border-radius: 16px; object-fit: cover; background: var(--surface-2); border: 1px solid #303947; }
.server-icon-fallback { display: grid; place-items: center; font-weight: 950; letter-spacing: -.04em; color: #cfd5de; }
.server-live-dot { position: absolute; right: -2px; bottom: 2px; width: 12px; height: 12px; background: #444d59; border: 3px solid var(--surface); border-radius: 50%; }
.connected .server-live-dot { background: var(--green); }
.server-card-copy { min-width: 0; }
.server-card-copy h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-card-copy p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.server-card-meter { padding: 0 18px 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; }
.server-card-meter > span, .server-card-meter > b { font-size: 8px; letter-spacing: .12em; font-weight: 900; color: var(--faint); }
.server-card-meter > b { color: var(--muted); }
.server-card-meter > div { height: 3px; background: #202731; overflow: hidden; }
.server-card-meter i { display: block; height: 100%; background: var(--faint); }
.connected .server-card-meter i { background: var(--primary-2); }
.server-card-actions { border-top: 1px solid var(--line-soft); display: flex; min-width: 0; }
.card-action { height: 44px; padding: 0 12px; border-right: 1px solid var(--line-soft); display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 850; flex: 1; transition: .14s ease; }
.card-action:hover { background: var(--surface-2); color: var(--text); }
.card-action.primary { color: white; background: rgba(88,101,242,.12); }
.card-action.primary:hover { background: var(--primary); }
.card-action.wide { flex: 4; }
.card-action.icon-only { flex: 0 0 44px; padding: 0; border-right: 0; }
.card-action .icon { width: 14px; height: 14px; }
.empty-state { margin-top: 28px; border: 1px dashed var(--line); min-height: 160px; display: grid; place-items: center; align-content: center; gap: 5px; color: var(--muted); }
.empty-state strong { color: var(--text); }
.empty-state span { font-size: 12px; }

.guild-screen { padding: 22px 0 70px; }
.guild-commandbar { position: relative; min-height: 82px; display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid var(--line); background: #0d1116; }
.icon-square { width: 38px; height: 38px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.icon-square:hover { color: var(--text); border-color: #485465; }
.command-server-icon { width: 46px; height: 46px; object-fit: cover; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); }
.command-title { min-width: 190px; }
.command-title span { color: var(--faint); font-size: 8px; letter-spacing: .16em; font-weight: 900; }
.command-title h1 { margin: 3px 0 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.command-status { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 9px; letter-spacing: .11em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(56,217,150,.08); }
.command-meta { display: flex; gap: 14px; margin-left: auto; color: var(--muted); font-size: 10px; }
.command-meta span + span { padding-left: 14px; border-left: 1px solid var(--line); }
.command-actions { display: flex; gap: 7px; }
.unsaved-flag { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--yellow); transition: width .18s ease; overflow: hidden; text-indent: -999px; }
.unsaved-flag.visible { width: 100%; }
.guild-deck { margin-top: 12px; display: grid; grid-template-columns: 238px minmax(0,1fr); min-height: 650px; border: 1px solid var(--line); background: var(--surface); }
.deck-nav { padding: 15px 10px; border-right: 1px solid var(--line); background: #0d1116; }
.deck-nav-label { padding: 10px 9px 6px; color: #566170; font-size: 8px; letter-spacing: .17em; font-weight: 900; }
.deck-nav-item { width: 100%; min-height: 42px; padding: 0 10px; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 9px; border: 0; border-left: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
.deck-nav-item:hover { color: var(--text); background: #12171e; }
.deck-nav-item.active { color: white; background: var(--surface-2); border-left-color: var(--primary-2); }
.deck-nav-item > span:not(.icon) { font-size: 11px; font-weight: 800; }
.deck-nav-item small { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: 9px; }
.state-dot { width: 5px; height: 5px; border-radius: 50%; background: #4d5663; }
.state-dot.on { background: var(--green); }
.deck-telemetry { margin: 18px 8px 0; padding-top: 13px; border-top: 1px solid var(--line-soft); display: grid; gap: 9px; }
.deck-telemetry span { color: #596473; font-size: 8px; letter-spacing: .07em; display: flex; justify-content: space-between; }
.deck-telemetry b { color: #a6afbb; }
.deck-workspace { min-width: 0; padding: 30px 34px 36px; background: var(--surface); }
.workspace-head { min-height: 76px; display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; border-bottom: 1px solid var(--line-soft); padding-bottom: 22px; margin-bottom: 24px; }
.workspace-head > div > span { color: var(--primary-2); font-size: 8px; letter-spacing: .17em; font-weight: 900; }
.workspace-head h2 { margin: 5px 0 6px; font-size: 30px; letter-spacing: -.045em; }
.workspace-head p { margin: 0; color: var(--muted); font-size: 12px; }

.overview-grid { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 16px; }
.module-list { border: 1px solid var(--line); background: #0d1116; }
.module-row { min-height: 78px; display: grid; grid-template-columns: 38px 1fr auto auto; gap: 13px; align-items: center; padding: 0 15px; border-bottom: 1px solid var(--line-soft); }
.module-row:last-child { border-bottom: 0; }
.module-row-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); color: #aab3c0; background: var(--surface); }
.module-row > div:nth-child(2) { display: grid; gap: 4px; }
.module-row > div:nth-child(2) b { font-size: 12px; }
.module-row > div:nth-child(2) span { color: var(--muted); font-size: 10px; }
.module-row-state { color: var(--faint); font-size: 8px; letter-spacing: .13em; font-weight: 900; }
.module-row-state.on { color: var(--green); }
.mini-button { min-height: 32px; padding: 0 10px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 850; }
.mini-button:hover { color: var(--text); border-color: #465264; background: var(--surface-2); }
.mini-button .icon { width: 12px; }
.overview-side { display: grid; gap: 9px; align-content: start; }
.telemetry-card { min-height: 88px; border: 1px solid var(--line); background: #0d1116; padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: start; }
.telemetry-card > span { color: var(--faint); font-size: 8px; letter-spacing: .13em; font-weight: 900; }
.telemetry-card b { grid-row: 1 / span 2; grid-column: 2; font-size: 28px; line-height: 1; }
.telemetry-card small { color: var(--muted); font-size: 9px; }
.diagnostic-cta { min-height: 70px; border: 1px solid var(--primary); background: rgba(88,101,242,.08); color: var(--text); display: grid; grid-template-columns: 24px 1fr 16px; align-items: center; gap: 10px; text-align: left; padding: 0 13px; cursor: pointer; }
.diagnostic-cta:hover { background: rgba(88,101,242,.16); }
.diagnostic-cta > span { display: grid; gap: 3px; }
.diagnostic-cta b { font-size: 10px; }
.diagnostic-cta small { color: var(--muted); font-size: 9px; }

.power-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.power-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.power-toggle span { width: 38px; height: 20px; border: 1px solid #48515d; background: #252c35; position: relative; }
.power-toggle span::before { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: #7d8794; transition: .16s ease; }
.power-toggle input:checked + span { border-color: var(--primary); background: rgba(88,101,242,.16); }
.power-toggle input:checked + span::before { left: 21px; background: var(--primary-2); }
.power-toggle b { font-size: 10px; }
.workspace-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,.9fr); gap: 18px; align-items: start; }
.control-panel { border: 1px solid var(--line); background: #0d1116; padding: 18px; display: grid; gap: 18px; }
.control-panel.narrow { max-width: 720px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 10px; font-weight: 850; color: #cbd2dc; }
.field small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.field select, .field textarea { width: 100%; border: 1px solid var(--line); background: #090c10; color: var(--text); outline: none; border-radius: 0; }
.field select { height: 40px; padding: 0 11px; }
.field textarea { min-height: 130px; resize: vertical; padding: 11px; line-height: 1.55; }
.field select:focus, .field textarea:focus { border-color: var(--primary-2); box-shadow: inset 2px 0 0 var(--primary-2); }
.variable-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.variable-bar > span { margin-right: 3px; color: var(--muted); font-size: 9px; }
.variable-bar button { border: 1px solid var(--line); background: var(--surface); color: #aeb8c5; padding: 5px 8px; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.variable-bar button:hover { border-color: var(--primary); color: white; }
.preview-console { border: 1px solid var(--line); background: #313338; min-height: 260px; }
.preview-console-top, .preview-console-foot { height: 38px; padding: 0 12px; background: #1e1f22; border-bottom: 1px solid #3f4147; display: flex; align-items: center; justify-content: space-between; color: #949ba4; font-size: 8px; letter-spacing: .12em; font-weight: 850; }
.preview-console-top b { color: #dbdee1; }
.preview-console-foot { border-top: 1px solid #3f4147; border-bottom: 0; justify-content: flex-start; }
.discord-message { display: grid; grid-template-columns: 40px 1fr; gap: 11px; padding: 22px 16px; }
.bot-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: white; font-weight: 950; }
.message-author { display: flex; align-items: baseline; gap: 6px; }
.message-author b { font-size: 13px; }
.message-author span { background: #5865f2; padding: 1px 4px; border-radius: 3px; font-size: 7px; font-weight: 900; }
.message-author small { color: #949ba4; font-size: 9px; }
.discord-message p { color: #dbdee1; font-size: 12px; line-height: 1.5; margin: 5px 0 0; }
.discord-message mark { color: #c9cdfb; background: #5865f24d; padding: 0 2px; }
.permission-readout { border: 1px solid var(--line); background: var(--surface); min-height: 66px; padding: 12px; display: flex; align-items: center; gap: 11px; }
.permission-readout > span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid currentColor; font-weight: 900; }
.permission-readout > div { display: grid; gap: 3px; }
.permission-readout b { font-size: 10px; }
.permission-readout small { color: var(--muted); font-size: 9px; }
.permission-readout.good { color: var(--green); }
.permission-readout.bad { color: var(--red); }
.event-matrix { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); background: #0d1116; }
.event-matrix span { min-height: 54px; display: grid; place-items: center; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 8px; letter-spacing: .08em; font-weight: 850; }
.event-matrix span:nth-child(2n) { border-right: 0; }
.event-matrix span:nth-last-child(-n+2) { border-bottom: 0; }
.coming-panel { border: 1px solid var(--line); background: #0d1116; min-height: 110px; padding: 18px; display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center; }
.coming-icon { width: 42px; height: 42px; border: 1px solid var(--primary); color: var(--primary-2); display: grid; place-items: center; font-size: 20px; font-weight: 900; }
.coming-panel > div:nth-child(2) { display: grid; gap: 4px; }
.coming-panel b { font-size: 12px; }
.coming-panel span { color: var(--muted); font-size: 10px; }
.diagnostics-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.75fr); gap: 18px; }
.diagnostic-readout { min-height: 150px; border: 1px solid var(--line); background: #0d1116; padding: 20px; display: flex; align-items: center; gap: 15px; }
.diagnostic-orb { width: 38px; height: 38px; border: 1px solid #56606e; position: relative; }
.diagnostic-orb::after { content: ''; position: absolute; inset: 10px; background: #56606e; }
.diagnostic-readout > div { display: grid; gap: 4px; }
.diagnostic-readout b { font-size: 12px; }
.diagnostic-readout small { color: var(--muted); font-size: 10px; }
.diagnostic-readout.running .diagnostic-orb { border-color: var(--yellow); }
.diagnostic-readout.running .diagnostic-orb::after { background: var(--yellow); animation: ping 1s infinite alternate; }
.diagnostic-readout.success .diagnostic-orb { border-color: var(--green); }
.diagnostic-readout.success .diagnostic-orb::after { background: var(--green); }
.diagnostic-readout.error .diagnostic-orb { border-color: var(--red); }
.diagnostic-readout.error .diagnostic-orb::after { background: var(--red); }
@keyframes ping { from { transform: scale(.65); opacity: .55; } to { transform: scale(1); opacity: 1; } }
.muted { color: #949ba4; }

.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 300px; max-width: 420px; border: 1px solid var(--line); background: #10151b; box-shadow: var(--shadow); padding: 11px 13px; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; opacity: 0; transform: translateY(8px); transition: .16s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast > span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--green); color: var(--green); font-weight: 900; }
.toast.error > span { border-color: var(--red); color: var(--red); }
.toast > div { display: grid; gap: 2px; }
.toast strong { font-size: 10px; }
.toast small { color: var(--muted); font-size: 9px; }

@media (max-width: 1180px) {
  .server-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .command-meta { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-side { grid-template-columns: repeat(3, 1fr); }
  .diagnostic-cta { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .main-shell { width: min(100% - 28px, 1420px); }
  .topbar { grid-template-columns: 1fr auto; padding: 0 14px; }
  .global-status { display: none; }
  .login-screen { grid-template-columns: 1fr; gap: 30px; padding: 70px 0; }
  .login-console { justify-self: stretch; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .server-toolbar { flex-direction: column; }
  .search-field { width: 100%; }
  .segmented-control { align-self: flex-start; }
  .guild-commandbar { flex-wrap: wrap; }
  .command-actions { width: 100%; }
  .command-actions .button { flex: 1; }
  .guild-deck { grid-template-columns: 1fr; }
  .deck-nav { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; gap: 3px; }
  .deck-nav-label, .deck-telemetry { display: none; }
  .deck-nav-item { width: auto; flex: 0 0 auto; grid-template-columns: 18px auto; border-left: 0; border-bottom: 2px solid transparent; }
  .deck-nav-item small { display: none; }
  .deck-nav-item.active { border-left: 0; border-bottom-color: var(--primary-2); }
  .workspace-split, .diagnostics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .server-card-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 40px; }
  .deck-stats { width: 100%; }
  .deck-stats div { min-width: 0; flex: 1; }
  .server-toolbar { margin-top: 24px; }
  .user-chip > span { display: none; }
  .topbar-button { display: none; }
  .deck-workspace { padding: 22px 16px 28px; }
  .workspace-head { flex-direction: column; }
  .overview-side { grid-template-columns: 1fr; }
  .module-row { grid-template-columns: 34px 1fr auto; padding: 10px; }
  .module-row-state { display: none; }
  .mini-button { grid-column: 2 / -1; justify-self: start; }
  .server-card-actions { overflow-x: auto; }
  .card-action { min-width: 90px; }
}
