:root {
  color-scheme: light;
  --mgs-ds-bg: #f8f9fc;
  --mgs-ds-surface-1: #ffffff;
  --mgs-ds-surface-2: #ffffff;
  --mgs-ds-surface-3: #f4f5f8;
  --mgs-ds-border: #dfe3ea;
  --mgs-ds-border-strong: #cbd1dc;
  --mgs-ds-text: #1f2433;
  --mgs-ds-text-muted: #646e87;
  --mgs-ds-text-dim: #939db8;
  --mgs-ds-primary-400: #7c87f7;
  --mgs-ds-primary-500: #5b63d3;
  --mgs-ds-focus: 0 0 0 3px rgba(115, 59, 229, 0.35);
  --mgs-ds-shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.24);
  --mgs-ds-shadow-md: 0 14px 34px rgba(0, 0, 0, 0.32);
  --mgs-ds-radius-8: 8px;
  --mgs-ds-radius-12: 12px;
  --mgs-ds-radius-16: 16px;
  --mgs-ds-radius-20: 20px;
  --mgs-ds-space-8: 8px;
  --mgs-ds-space-10: 10px;
  --mgs-ds-space-12: 12px;
  --mgs-ds-space-16: 16px;
  --mgs-ds-space-20: 20px;
  --suite-bg: #f5f7fb;
  --suite-surface: #e6e6e6;
  --suite-text: #171a21;
  --suite-muted: #616775;
  --suite-border: #dce1ea;
  --suite-primary: #6558d3;
  --suite-primary-hover: #5145b8;
  --suite-focus: #2f6feb;
  --suite-danger-bg: #fff1f2;
  --suite-danger-text: #9f1239;
  --suite-radius: 16px;
  --suite-shadow: 0 12px 32px rgba(28, 32, 43, 0.08);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --mgs-ds-bg: #f8f9fc;
  --mgs-ds-surface-1: #ffffff;
  --mgs-ds-surface-2: #ffffff;
  --mgs-ds-surface-3: #f4f5f8;
  --mgs-ds-border: #dfe3ea;
  --mgs-ds-border-strong: #cbd1dc;
  --mgs-ds-text: #1f2433;
  --mgs-ds-text-muted: #646e87;
  --mgs-ds-text-dim: #939db8;
  --suite-bg: var(--mgs-ds-bg);
  --suite-surface: var(--mgs-ds-surface-2);
  --suite-text: var(--mgs-ds-text);
  --suite-muted: var(--mgs-ds-text-muted);
  --suite-border: var(--mgs-ds-border);
  --suite-primary: var(--mgs-ds-primary-500);
  --suite-primary-hover: var(--mgs-ds-primary-400);
  --suite-focus: var(--mgs-ds-primary-400);
  --suite-shadow: 0 12px 32px rgba(28, 32, 43, 0.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --mgs-ds-bg: #1f2433;
  --mgs-ds-surface-1: #222838;
  --mgs-ds-surface-2: #222838;
  --mgs-ds-surface-3: #2f3647;
  --mgs-ds-border: rgba(255, 255, 255, 0.08);
  --mgs-ds-border-strong: rgba(255, 255, 255, 0.14);
  --mgs-ds-text: #ffffff;
  --mgs-ds-text-muted: #b8bfd1;
  --mgs-ds-text-dim: #939db8;
  --suite-bg: var(--mgs-ds-bg);
  --suite-surface: var(--mgs-ds-surface-2);
  --suite-text: var(--mgs-ds-text);
  --suite-muted: var(--mgs-ds-text-muted);
  --suite-border: var(--mgs-ds-border);
  --suite-primary: var(--mgs-ds-primary-400);
  --suite-primary-hover: #a18cff;
  --suite-focus: var(--mgs-ds-primary-400);
  --suite-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--suite-text);
  background: var(--suite-bg);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 3px solid var(--suite-focus);
  outline-offset: 3px;
}

.suite-main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(44px, 8vw, 92px) 0;
}

.suite-intro {
  max-width: 670px;
  margin-bottom: 32px;
}

.suite-eyebrow {
  margin: 0 0 10px;
  color: var(--suite-primary);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1.08;
}

.suite-lead,
.app-card p,
.empty-state p,
.status-page p {
  color: var(--suite-muted);
  line-height: 1.6;
}

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

.app-card {
  display: grid;
  align-content: start;
  min-height: 240px;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid var(--suite-border);
  border-radius: var(--suite-radius);
  background: var(--suite-surface);
  box-shadow: var(--suite-shadow);
}

.app-card h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.app-card p {
  margin-bottom: 32px;
}

.suite-button {
  align-self: end;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--suite-primary);
  border-radius: 10px;
  color: #ffffff;
  background: var(--suite-primary);
  font-weight: 700;
  text-decoration: none;
}

.suite-button:hover {
  border-color: var(--suite-primary-hover);
  background: var(--suite-primary-hover);
}

.suite-button--secondary {
  border-color: var(--suite-border);
  color: var(--suite-text);
  background: rgba(255, 255, 255, 0.06);
}

.suite-button--secondary:hover {
  border-color: rgba(161, 140, 255, 0.62);
  background: rgba(138, 108, 255, 0.14);
}

.suite-home-page {
  --suite-bg: #080d14;
  --suite-surface: rgba(18, 25, 35, 0.82);
  --suite-text: #f7f8fb;
  --suite-muted: #aeb7c6;
  --suite-border: rgba(135, 151, 176, 0.22);
  --suite-primary: #8a6cff;
  --suite-primary-hover: #a18cff;
  --suite-focus: #a18cff;
  --suite-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
  background:
    radial-gradient(circle at 18% 12%, rgba(138, 108, 255, 0.15), transparent 28%),
    radial-gradient(circle at 78% 0%, rgba(64, 89, 133, 0.18), transparent 34%),
    linear-gradient(135deg, #070b12 0%, #0b111a 48%, #060a10 100%);
}

.suite-home-page .suite-main {
  width: min(980px, calc(100% - 40px));
  padding: clamp(24px, 4vw, 52px) 0 clamp(40px, 6vw, 72px);
}

.suite-home-page .suite-intro {
  max-width: 460px;
  margin-bottom: 24px;
}

.suite-home-page .suite-eyebrow {
  letter-spacing: 0.28em;
}

.go-card .suite-eyebrow {
  text-transform: none;
}

.suite-home-page h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.45rem);
  letter-spacing: 0;
}

.suite-home-page h1 span {
  color: var(--suite-primary);
  text-shadow: 0 0 28px rgba(138, 108, 255, 0.36);
}

.suite-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 390px);
  min-height: 48px;
  margin-top: 24px;
  padding: 0 16px;
  border: 1px solid var(--suite-border);
  border-radius: 9px;
  background: var(--mgs-ds-surface-1);
  box-shadow: 0 1px 2px rgba(28, 32, 43, 0.06);
}

.suite-search:focus-within {
  border-color: var(--suite-primary);
  box-shadow: var(--mgs-ds-focus);
}

.suite-search__icon,
.suite-search svg {
  width: 22px;
  height: 22px;
  color: var(--mgs-ds-text-muted);
  flex: 0 0 auto;
}

.suite-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--suite-text);
  background: transparent;
}

.suite-search input::placeholder {
  color: var(--mgs-ds-text-dim);
}

html[data-theme="dark"] .suite-search {
  background: rgba(16, 23, 33, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .suite-search:focus-within {
  box-shadow: var(--mgs-ds-focus);
}

html[data-theme="dark"] .suite-search__icon,
html[data-theme="dark"] .suite-search svg {
  color: #e3e8f1;
}

html[data-theme="dark"] .suite-search input::placeholder {
  color: #838c9c;
}

.suite-tools h2 {
  margin-bottom: 16px;
  font-size: 1.18rem;
}

.suite-home-page .app-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.suite-home-page .app-card {
  position: relative;
  min-height: 168px;
  padding: 20px;
  overflow: hidden;
  border-color: var(--suite-border);
  border-radius: 8px;
  color: var(--suite-text);
  background: var(--mgs-ds-surface-1);
  box-shadow: var(--suite-shadow);
}

.suite-home-page .app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
  opacity: 0;
}

.app-card__icon {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  color: var(--mgs-ds-text-muted);
}

.app-card__icon svg {
  width: 34px;
  height: 34px;
}

.suite-home-page .app-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 42px 7px 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.suite-home-page .app-card p {
  position: relative;
  z-index: 1;
  max-width: 220px;
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.45;
}

.app-card__action {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 34px;
  border: 1px solid var(--suite-border);
  border-radius: 7px;
  color: var(--mgs-ds-text-muted);
  background: var(--mgs-ds-surface-3);
  text-decoration: none;
}

.app-card__action:not(.app-card__action--disabled):hover {
  border-color: var(--suite-primary);
  color: var(--suite-primary);
  background: rgba(138, 108, 255, 0.18);
}

.app-card__action svg {
  width: 20px;
  height: 20px;
}

.app-card--disabled {
  color: var(--mgs-ds-text-muted);
  background: var(--mgs-ds-surface-3);
}

.app-card__action--disabled {
  color: var(--mgs-ds-text-dim);
}

html[data-theme="dark"] .suite-home-page .app-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(13, 20, 29, 0.82);
}

html[data-theme="dark"] .suite-home-page .app-card::before {
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.07), transparent 42%);
  opacity: 0.56;
}

html[data-theme="dark"] .app-card__icon {
  color: #dce3ef;
}

html[data-theme="dark"] .app-card__action {
  color: #eef3fb;
  background: rgba(14, 21, 31, 0.62);
}

html[data-theme="dark"] .app-card__action:not(.app-card__action--disabled):hover {
  border-color: rgba(161, 140, 255, 0.62);
  color: #ffffff;
}

html[data-theme="dark"] .app-card--disabled {
  opacity: 0.78;
}

html[data-theme="dark"] .app-card__action--disabled {
  color: #748095;
}

.go-landing-page .suite-main {
  width: min(760px, calc(100% - 40px));
}

.go-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  color: var(--suite-muted);
  font-size: 0.8125rem;
}

.go-breadcrumb a {
  text-decoration: none;
}

.go-breadcrumb a:hover,
.go-breadcrumb strong {
  color: var(--suite-text);
}

.go-landing {
  display: grid;
  min-height: calc(100vh - 220px);
  align-items: center;
}

.go-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--suite-border);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014)),
    rgba(13, 20, 29, 0.86);
  box-shadow: var(--suite-shadow);
}

.go-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.08), transparent 46%);
  opacity: 0.6;
}

.go-card > * {
  position: relative;
  z-index: 1;
}

.go-card__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border: 1px solid var(--suite-border);
  border-radius: 10px;
  color: #efeaff;
  background: rgba(138, 108, 255, 0.12);
}

.go-card__logo svg {
  width: 28px;
  height: 28px;
}

.go-landing-page h1 {
  max-width: 560px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.go-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 14px;
}

.go-card__actions .suite-button {
  gap: 9px;
}

.go-card__actions .suite-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
}

.go-card__notice {
  margin: 0 0 24px;
  color: var(--suite-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.go-card__notice:focus {
  outline: 0;
}

.go-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.go-steps section,
.go-card__device-url {
  border: 1px solid var(--suite-border);
  border-radius: 8px;
  background: rgba(8, 13, 20, 0.5);
}

.go-steps section {
  padding: 18px;
}

.go-steps h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 1rem;
}

.go-steps h2 svg {
  width: 18px;
  height: 18px;
  color: var(--suite-primary-hover);
}

.go-steps ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--suite-muted);
  line-height: 1.45;
}

.go-card__device-url {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 14px 16px;
}

.go-card__device-url span {
  color: var(--suite-muted);
  font-size: 0.86rem;
}

.go-card__device-url strong {
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

body.app {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  overflow: hidden;
  background: var(--mgs-ds-bg);
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--mgs-ds-space-20);
  padding: var(--mgs-ds-space-20);
}

.system-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body.app > .app-shell {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--mgs-ds-space-20);
}

body.app > .app-shell:has(.sidebar:hover),
body.app > .app-shell:has(.sidebar:focus-within) {
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar,
.panel-main {
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.panel-main {
  border-radius: var(--mgs-ds-radius-20);
}

body.app .suite-main {
  width: min(980px, 100%);
  margin: 0 auto;
}

.mobile-header,
.sidebar-backdrop {
  display: none;
}

.sidebar {
  --sidebar-item-size: 44px;
  --sidebar-icon-size: 20px;
  position: relative;
  width: 76px;
  min-width: 76px;
  padding: var(--mgs-ds-space-16) 15px;
  display: flex;
  flex-direction: column;
  gap: var(--mgs-ds-space-16);
  overflow-x: hidden;
  border: 1px solid var(--mgs-ds-border);
  border-radius: var(--mgs-ds-radius-20);
  background: var(--mgs-ds-surface-2);
  box-shadow: var(--mgs-ds-shadow-sm);
  transition: width 180ms ease, box-shadow 180ms ease;
}

.sidebar:hover,
.sidebar:focus-within {
  width: 240px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.sidebar-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.sidebar__top,
.sidebar__bottom {
  position: relative;
  z-index: 1;
}

.sidebar__top {
  flex: 1 1 auto;
  min-height: 0;
  min-width: var(--sidebar-item-size);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.sidebar__bottom {
  flex: 0 0 auto;
  display: grid;
  gap: var(--mgs-ds-space-8);
  min-width: var(--sidebar-item-size);
  padding-top: var(--mgs-ds-space-12);
  border-top: 1px solid var(--mgs-ds-border);
}

.sidebar:hover .sidebar__top,
.sidebar:hover .sidebar__bottom,
.sidebar:focus-within .sidebar__top,
.sidebar:focus-within .sidebar__bottom {
  min-width: 208px;
}

.sidebar-brand {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--mgs-ds-space-20);
  text-decoration: none;
}

.sidebar-brand__mark {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mgs-ds-radius-12);
  color: #ffffff;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
}

.sidebar-brand__mark img {
  display: block;
  width: 100%;
  max-width: 32px;
  height: 100%;
  max-height: 32px;
  object-fit: contain;
}

.sidebar__mobile-header {
  display: none;
}

.sidebar__nav,
.nav__group {
  display: grid;
  gap: 6px;
}

.nav__item,
.sidebar-theme-toggle {
  min-height: var(--sidebar-item-size);
  display: flex;
  align-items: center;
  gap: var(--mgs-ds-space-10);
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--mgs-ds-radius-12);
  color: var(--mgs-ds-text);
  background: transparent;
  text-decoration: none;
}

.sidebar-theme-toggle {
  height: var(--sidebar-item-size);
  padding: 8px 10px;
  color: var(--mgs-ds-text-muted);
  cursor: pointer;
}

.nav__item:hover,
.sidebar-theme-toggle:hover {
  color: var(--mgs-ds-text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--mgs-ds-border);
}

html[data-theme="light"] .nav__item:hover,
html[data-theme="light"] .sidebar-theme-toggle:hover {
  background: var(--mgs-ds-surface-3);
}

.nav__item:focus-visible,
.sidebar-theme-toggle:focus-within,
.sidebar__mobile-close:focus-visible,
.mobile-header__button:focus-visible,
.nav__item--logout:focus-visible {
  outline: none;
  box-shadow: var(--mgs-ds-focus);
}

.nav__item--active {
  background: rgba(91, 99, 211, 0.16);
  border-color: rgba(91, 99, 211, 0.28);
}

.nav__icon {
  position: relative;
  width: var(--sidebar-icon-size);
  height: var(--sidebar-icon-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.nav__icon svg,
.nav__item--logout svg {
  width: var(--sidebar-icon-size);
  height: var(--sidebar-icon-size);
  display: block;
  color: currentColor;
}

.sidebar-theme-toggle > span:nth-child(2) {
  flex: 1 1 auto;
}

.sb-toggle-wrap {
  position: relative;
  width: 28px;
  height: 16px;
  flex: 0 0 28px;
}

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

.sb-toggle-track {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 999px;
  background: var(--mgs-ds-border-strong);
  transition: background 140ms ease;
}

.sb-toggle-input:checked + .sb-toggle-track {
  background: var(--mgs-ds-primary-500);
}

.sb-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
  transition: transform 140ms ease;
}

.sb-toggle-input:checked + .sb-toggle-track .sb-toggle-thumb {
  transform: translateX(12px);
}

.sidebar-user {
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: var(--mgs-ds-space-10);
  padding: 8px 4px;
  border: 1px solid var(--mgs-ds-border);
  border-radius: var(--mgs-ds-radius-12);
  background: var(--mgs-ds-surface-1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  border: 1px solid var(--mgs-ds-border);
  border-radius: 50%;
  color: #ffffff;
  background: var(--mgs-ds-primary-500);
  font-size: 0.82rem;
  font-weight: 800;
}

.sidebar-user .user-info {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 1px;
}

.sidebar-user .user-name,
.sidebar-user .user-badge {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 16px;
}

.sidebar-user .user-name {
  color: var(--mgs-ds-text);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-user .user-badge {
  color: var(--mgs-ds-text-dim);
  font-size: 10px;
}

.sidebar-user form {
  margin: 0;
}

.nav__item--logout {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  color: var(--mgs-ds-text-dim);
  border-radius: var(--mgs-ds-radius-8);
  background: transparent;
  cursor: pointer;
}

.nav__item--logout:hover {
  color: var(--mgs-ds-text);
  background: var(--mgs-ds-surface-3);
}

.sidebar:not(:hover):not(:focus-within) .nav__item,
.sidebar:not(:hover):not(:focus-within) .sidebar-theme-toggle {
  width: var(--sidebar-item-size);
  min-height: var(--sidebar-item-size);
  padding: 0;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar:not(:hover):not(:focus-within) .sidebar-user {
  width: var(--sidebar-item-size);
  min-height: 52px;
  height: 52px;
  padding: 0;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
}

.sidebar:not(:hover):not(:focus-within) .nav__item > span:not(.nav__icon),
.sidebar:not(:hover):not(:focus-within) .sidebar-theme-toggle > span:not(.nav__icon),
.sidebar:not(:hover):not(:focus-within) .user-info,
.sidebar:not(:hover):not(:focus-within) .nav__item--logout {
  display: none;
}

.suite-home-page {
  --suite-bg: var(--mgs-ds-bg);
  --suite-surface: var(--mgs-ds-surface-2);
  --suite-text: var(--mgs-ds-text);
  --suite-muted: var(--mgs-ds-text-muted);
  --suite-border: var(--mgs-ds-border);
  --suite-primary: var(--mgs-ds-primary-400);
  --suite-primary-hover: #a18cff;
  --suite-focus: var(--mgs-ds-primary-400);
  --suite-shadow: var(--mgs-ds-shadow-md);
  background: var(--mgs-ds-bg);
}

html[data-theme="light"] .suite-home-page {
  --suite-primary-hover: var(--mgs-ds-primary-500);
  --suite-shadow: 0 12px 32px rgba(28, 32, 43, 0.08);
}

.empty-state,
.status-page,
.login-card {
  padding: clamp(26px, 5vw, 40px);
  border: 1px solid var(--suite-border);
  border-radius: var(--suite-radius);
  background: var(--suite-surface);
  box-shadow: var(--suite-shadow);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-page .auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 26%, rgba(138, 108, 255, 0.13), transparent 24%),
    radial-gradient(circle at 72% 18%, rgba(64, 89, 133, 0.14), transparent 34%);
}

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

.login-page .login-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 390px);
  padding: 30px;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014)),
    rgba(13, 20, 29, 0.86);
}

.login-page .login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.08), transparent 46%);
  opacity: 0.6;
}

.login-page .login-card > * {
  position: relative;
  z-index: 1;
}

.login-card h1 {
  font-size: 2rem;
}

.login-page .login-card h1 {
  margin-bottom: 10px;
  font-size: 2.2rem;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.login-page .login-form {
  gap: 16px;
  margin-top: 24px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  font-size: 0.92rem;
  font-weight: 700;
}

.login-page .form-field label {
  color: #eef3fb;
  font-size: 0.88rem;
}

.form-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #b7bfcc;
  border-radius: 10px;
  color: var(--suite-text);
  background: #ffffff;
}

.login-page .form-field input {
  border-color: rgba(135, 151, 176, 0.28);
  color: var(--suite-text);
  background: rgba(8, 13, 20, 0.58);
}

.form-field input:focus {
  border-color: var(--suite-focus);
}

.login-page .form-field input:focus {
  box-shadow: 0 0 0 3px rgba(138, 108, 255, 0.18);
}

.login-form .suite-button {
  width: 100%;
  margin-top: 4px;
  cursor: pointer;
}

.login-page .login-form .suite-button {
  min-height: 46px;
}

.form-error {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--suite-danger-text);
  background: var(--suite-danger-bg);
  line-height: 1.45;
}

.status-page {
  max-width: 640px;
}

@media (max-width: 1024px) {
  body.app {
    display: block;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  body.app > .app-shell {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: var(--mgs-ds-space-12);
    height: 100dvh;
    max-height: 100dvh;
    padding: var(--mgs-ds-space-12);
    overflow: hidden;
  }

  body.app > .app-shell:has(.sidebar:hover),
  body.app > .app-shell:has(.sidebar:focus-within) {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-header {
    grid-column: 1;
    grid-row: 1;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mgs-ds-space-12);
    padding: 8px;
    border: 1px solid var(--mgs-ds-border);
    border-radius: var(--mgs-ds-radius-16);
    background: var(--mgs-ds-surface-2);
    box-shadow: var(--mgs-ds-shadow-sm);
  }

  .mobile-header__button,
  .mobile-header__profile {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    border: 1px solid var(--mgs-ds-border);
    border-radius: var(--mgs-ds-radius-12);
    color: var(--mgs-ds-text);
    background: var(--mgs-ds-surface-1);
  }

  .mobile-header__button {
    cursor: pointer;
  }

  .mobile-header__button svg {
    width: 20px;
    height: 20px;
  }

  .mobile-header__title {
    min-width: 0;
    overflow: hidden;
    color: var(--mgs-ds-text);
    font-size: 0.95rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-header__profile {
    color: #ffffff;
    background: var(--mgs-ds-primary-500);
    font-size: 0.82rem;
    font-weight: 800;
  }

  .panel-main {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 2100;
    width: min(320px, calc(100vw - 48px));
    min-width: 0;
    height: 100dvh;
    max-height: none;
    border-width: 0 1px 0 0;
    border-radius: 0 var(--mgs-ds-radius-20) var(--mgs-ds-radius-20) 0;
    box-shadow: var(--mgs-ds-shadow-md);
    visibility: hidden;
    transform: translateX(-105%);
    transition: transform 180ms ease, visibility 0s linear 180ms;
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: min(320px, calc(100vw - 48px));
  }

  body.sidebar-open .sidebar {
    visibility: visible;
    transform: translateX(0);
    transition-delay: 0s;
  }

  .sidebar__mobile-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mgs-ds-space-12);
    padding-bottom: var(--mgs-ds-space-12);
    border-bottom: 1px solid var(--mgs-ds-border);
  }

  .sidebar__top .sidebar-brand {
    display: none;
  }

  .sidebar__mobile-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--mgs-ds-space-10);
    border: 1px solid var(--mgs-ds-border);
    border-radius: var(--mgs-ds-radius-12);
    color: var(--mgs-ds-text);
    background: var(--mgs-ds-surface-1);
    cursor: pointer;
  }

  .sidebar__mobile-close:hover {
    border-color: var(--mgs-ds-border-strong);
    background: var(--mgs-ds-surface-3);
  }

  .sidebar__mobile-close svg {
    width: 20px;
    height: 20px;
  }

  .sidebar__nav {
    padding-top: var(--mgs-ds-space-12);
  }

  .sidebar:not(:hover):not(:focus-within) .nav__item,
  .sidebar:not(:hover):not(:focus-within) .sidebar-theme-toggle,
  .nav__item,
  .sidebar-theme-toggle {
    width: 100%;
    justify-content: flex-start;
    gap: var(--mgs-ds-space-10);
    padding: 10px 12px;
  }

  .sidebar:not(:hover):not(:focus-within) .nav__item > span:not(.nav__icon),
  .sidebar:not(:hover):not(:focus-within) .sidebar-theme-toggle > span:not(.nav__icon),
  .sidebar:not(:hover):not(:focus-within) .user-info,
  .sidebar:not(:hover):not(:focus-within) .nav__item--logout {
    display: inline-flex;
  }

  .sidebar:not(:hover):not(:focus-within) .user-info {
    display: grid;
  }

  .sidebar:not(:hover):not(:focus-within) .sidebar-user,
  .sidebar-user {
    width: 100%;
    padding: 8px 4px;
    justify-content: flex-start;
    gap: var(--mgs-ds-space-10);
    border-color: var(--mgs-ds-border);
    background: var(--mgs-ds-surface-1);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: block;
    background: rgba(4, 7, 12, 0.58);
  }

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

@media (max-width: 700px) {
  .suite-home-page .suite-main {
    width: min(100% - 28px, 980px);
  }

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

  .suite-home-page .app-grid {
    grid-template-columns: 1fr;
  }

  .go-landing-page .suite-main {
    width: min(100% - 28px, 760px);
  }

  .go-steps {
    grid-template-columns: 1fr;
  }

  .go-card__actions {
    display: grid;
  }

  .app-card {
    min-height: 210px;
  }

}

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