:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #dce3ec;
  --text: #202936;
  --muted: #667085;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --teal: #0f766e;
  --green: #14804a;
  --amber: #b45309;
  --red: #b42318;
  --sidebar: #263442;
  --sidebar-strong: #1e2a36;
  --shadow: 0 10px 24px rgba(24, 39, 75, 0.08);
  --sidebar-width: 280px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body[data-context="micro"] {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body[data-context="catalog"] {
  background: #f6f8fb;
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

body.sidebar-collapsed {
  --sidebar-width: 4.875rem;
}

body[data-context="catalog"] .app-shell {
  display: block;
}

body[data-context="catalog"] .sidebar,
body[data-context="catalog"] .topbar {
  display: none;
}

body[data-context="catalog"] .content {
  padding: 0;
}

body[data-context="micro"] .app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "topbar topbar"
    "sidebar content";
}

body[data-context="micro"] .main {
  display: contents;
}

body[data-context="micro"] .topbar {
  grid-area: topbar;
}

body[data-context="micro"] .sidebar {
  grid-area: sidebar;
}

body[data-context="micro"] .content {
  grid-area: content;
}

.sidebar {
  background: var(--sidebar);
  color: #dfe7ef;
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

body[data-context="micro"] .sidebar {
  background: #263238;
  color: #fff;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
  height: calc(100vh - 4.125rem);
  top: 4.125rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.sidebar-collapse-button {
  display: inline-grid;
  grid-template-columns: 28px;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  width: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #c9d4df;
  padding: 0;
  text-align: center;
  font-weight: 800;
}

.micro-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.micro-menu-header h5 {
  margin: 0;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
}

.sidebar-collapse-button:hover {
  background: var(--sidebar-strong);
  color: #fff;
}

.sidebar-collapse-button .nav-icon {
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

body.sidebar-collapsed .sidebar-collapse-button .nav-icon {
  transform: rotate(180deg);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

body[data-context="micro"] .brand-mark {
  background: #0c83ff;
  border-radius: 0.375rem;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #9fb1c4;
  margin-top: 2px;
}

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

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  border: 0;
  background: transparent;
  color: #c9d4df;
  text-align: left;
  padding: 11px 12px;
  border-radius: 6px;
}

body[data-context="micro"] .nav-item {
  min-height: 42px;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 0.375rem;
  font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
  background: var(--sidebar-strong);
  color: #fff;
}

body[data-context="micro"] .nav-item:hover,
body[data-context="micro"] .nav-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

body[data-context="micro"] .nav-icon {
  background: transparent;
  font-size: 1.125rem;
}

body[data-context="micro"] .nav-icon i {
  display: block;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.sidebar-global-nav {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-card small,
.sidebar-card span {
  color: #afbdca;
  display: block;
}

.sidebar-card strong {
  display: block;
  margin: 4px 0;
}

body.sidebar-collapsed .sidebar {
  align-items: center;
  padding: 18px 12px;
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width) !important;
  max-width: var(--sidebar-width) !important;
  overflow-x: hidden;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  width: 100%;
}

body.sidebar-collapsed .brand div,
body.sidebar-collapsed .nav-item span:not(.nav-icon),
body.sidebar-collapsed .sidebar-collapse-label,
body.sidebar-collapsed .sidebar-resize-hide,
body.sidebar-collapsed .micro-menu-header h5,
body.sidebar-collapsed .sidebar-card {
  display: none;
}

body.sidebar-collapsed .sidebar-resize-show {
  display: inline-flex !important;
}

body.sidebar-collapsed .nav-group,
body.sidebar-collapsed .sidebar-footer,
body.sidebar-collapsed .sidebar-global-nav,
body.sidebar-collapsed .sidebar-collapse-button,
body.sidebar-collapsed .micro-menu-header {
  width: 100%;
}

body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .sidebar-collapse-button {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 10px;
  overflow: hidden;
}

body.sidebar-collapsed .nav-icon {
  width: 30px;
  height: 30px;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

body[data-context="micro"] .topbar {
  min-height: 4.125rem;
  background: #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-bottom: 0;
}

.topbar-title {
  min-width: 190px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

body[data-context="micro"] .breadcrumb {
  font-size: 0.75rem;
  letter-spacing: 0;
}

.breadcrumb span::before {
  content: "-";
  margin-right: 6px;
}

.breadcrumb-link {
  display: inline;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  padding: 0;
  text-align: left;
  text-transform: uppercase;
}

.breadcrumb-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.topbar-title span,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
}

body[data-context="micro"] h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu {
  position: relative;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  padding: 4px 8px;
  font-weight: 800;
}

body[data-context="micro"] .user-menu-button {
  border-radius: 999px;
  padding: 0.25rem 0.625rem 0.25rem 0.25rem;
  font-weight: 600;
}

.user-menu-button:hover,
.user-menu-button[aria-expanded="true"] {
  background: var(--surface-soft);
  border-color: var(--line);
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0ff;
  color: var(--primary-dark);
  font-weight: 900;
}

body[data-context="micro"] .user-avatar {
  background: #e6f1ff;
  color: #0c83ff;
}

.user-name {
  white-space: nowrap;
}

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

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 230px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(20, 36, 60, 0.16);
}

body[data-context="micro"] .user-dropdown {
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.user-dropdown button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  padding: 0 10px;
  text-align: left;
  font-weight: 700;
}

.user-dropdown button i {
  margin-right: 0.625rem;
  color: #6c757d;
  font-size: 1rem;
}

.user-dropdown button:hover {
  background: var(--surface-soft);
}

.user-dropdown hr {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 6px 0;
}

.menu-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.search {
  width: min(360px, 32vw);
}

.search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 0 11px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.content {
  padding: 24px;
}

body[data-context="micro"] .content {
  padding: 1.5rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric,
.panel,
.table-card,
.catalog-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

body[data-context="micro"] .metric,
body[data-context="micro"] .panel,
body[data-context="micro"] .table-card {
  border: 0;
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 26px;
  margin: 8px 0 4px;
}

.metric.warning strong {
  color: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.chart-panel {
  margin-bottom: 18px;
}

.chart-total {
  color: var(--primary-dark);
  font-weight: 800;
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}

.line-chart {
  display: block;
  width: 100%;
  min-width: 520px;
  height: 260px;
}

.chart-grid {
  stroke: #e6ebf2;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.expected-line {
  stroke: var(--primary);
}

.paid-line {
  stroke: var(--green);
}

.chart-dot {
  stroke: #fff;
  stroke-width: 2;
}

.expected-dot,
.open-dot {
  fill: var(--primary);
}

.paid-dot {
  fill: var(--green);
}

.chart-label,
.chart-empty {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

.panel {
  padding: 18px;
}

.panel-header,
.section-toolbar,
.table-header,
.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.task {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.task-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.task.overdue .task-dot {
  background: var(--red);
}

.roadmap {
  margin: 16px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 12px;
}

.section-toolbar {
  margin-bottom: 16px;
}

.segmented {
  display: flex;
  padding: 3px;
  background: #e7ecf3;
  border-radius: 7px;
}

.segmented button {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 5px;
  color: var(--muted);
}

.segmented button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(24, 39, 75, 0.1);
}

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

.launcher-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.launcher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.launcher-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

.launcher-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-weight: 800;
}

.launcher-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.launcher-nav button {
  border: 0;
  background: transparent;
  color: #475467;
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 999px;
}

.launcher-nav button:hover {
  background: #e9eef6;
  color: #111827;
}

.nav-pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.launcher-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 32px;
  align-items: center;
  min-height: 430px;
  padding: 36px 0 26px;
}

.hero-copy {
  display: grid;
  gap: 18px;
}

.hero-kicker {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-copy h2,
.my-apps-hero h2 {
  max-width: 760px;
  color: #111827;
  font-size: 48px;
  line-height: 1.02;
}

.hero-copy p,
.my-apps-hero p,
.installed-card p {
  color: #5f6b7a;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button.large,
.ghost-button.large {
  min-height: 46px;
  padding: 0 18px;
}

.hero-preview {
  min-height: 320px;
  border: 1px solid #d7e0ec;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(20, 36, 60, 0.15);
  padding: 22px;
}

.preview-bar,
.preview-row,
.preview-grid span {
  border-radius: 8px;
  background: #e9eef6;
}

.preview-bar {
  width: 42%;
  height: 18px;
  margin-bottom: 28px;
}

.preview-row {
  width: 74%;
  height: 14px;
  margin-bottom: 14px;
}

.preview-row.strong {
  width: 88%;
  height: 34px;
  background: #dbeafe;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.preview-grid span {
  height: 84px;
}

.solution-search {
  display: grid;
  gap: 10px;
  margin: 0 0 34px;
  padding: 20px;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(20, 36, 60, 0.08);
}

.solution-search label {
  color: #111827;
  font-size: 22px;
  font-weight: 900;
}

.solution-search input {
  height: 56px;
  border-radius: 12px;
  font-size: 17px;
}

.market-toolbar,
.my-apps-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.launcher-segmented {
  background: #e9eef6;
}

.catalog-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

body[data-context="catalog"] .catalog-card {
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(20, 36, 60, 0.08);
}

.catalog-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.catalog-card p {
  color: var(--muted);
  line-height: 1.45;
}

.app-price {
  color: #111827;
  font-size: 24px;
}

.app-pitch {
  color: #344054 !important;
  font-weight: 700;
}

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

.installed-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid #dfe7f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 36, 60, 0.08);
}

.installed-card h3 {
  margin-top: 10px;
  font-size: 22px;
}

.installed-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag {
  color: #344054;
  background: #eef2f7;
}

.status.success {
  color: var(--green);
  background: #e7f7ee;
}

.status.open {
  color: var(--primary-dark);
  background: #eaf1ff;
}

.status.paid {
  color: var(--green);
  background: #e7f7ee;
}

.status.overdue {
  color: var(--red);
  background: #ffebe9;
}

.status.soon {
  color: var(--amber);
  background: #fff4df;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 13px;
  font-weight: 700;
}

.catalog-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.catalog-open-link:hover {
  color: #fff;
}

.primary-button {
  color: #fff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.ghost-button {
  color: #344054;
  background: #fff;
  border-color: var(--line);
}

.ghost-button:hover {
  background: var(--surface-soft);
}

.ghost-button.small {
  min-height: 32px;
  padding: 0 10px;
}

.icon-button {
  width: 38px;
  padding: 0;
  color: #344054;
  background: #fff;
  border-color: var(--line);
}

.mobile-only {
  display: none;
}

.table-card {
  overflow: hidden;
}

.table-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.responsive-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

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

.micro-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.filters {
  display: grid;
  gap: 14px;
}

.filters label,
.form-grid label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-weight: 700;
}

.full {
  width: 100%;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.45);
}

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

.modal {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
  padding: 20px;
}

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

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

  .launcher-hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  body[data-context="micro"] .app-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "topbar"
      "content";
  }

  body[data-context="micro"] .main {
    display: contents;
  }

  body.sidebar-collapsed {
    --sidebar-width: 280px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 300px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body[data-context="micro"] .sidebar {
    height: 100vh;
    top: 0;
  }

  body.sidebar-collapsed .sidebar {
    align-items: stretch;
    padding: 18px;
  }

  body.sidebar-collapsed .brand {
    justify-content: flex-start;
  }

  body.sidebar-collapsed .brand div,
  body.sidebar-collapsed .nav-item span:not(.nav-icon),
  body.sidebar-collapsed .sidebar-collapse-label,
  body.sidebar-collapsed .micro-menu-header h5,
  body.sidebar-collapsed .sidebar-card {
    display: block;
  }

  body.sidebar-collapsed .nav-item,
  body.sidebar-collapsed .sidebar-collapse-button {
    grid-template-columns: 28px 1fr;
    justify-items: stretch;
    padding: 11px 12px;
  }

  body.sidebar-collapsed .sidebar-collapse-button {
    width: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
    padding: 12px 14px;
  }

  .topbar-actions {
    width: 100%;
    margin-left: 0;
  }

  .search {
    width: 100%;
  }

  .content {
    padding: 14px;
  }

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

@media (max-width: 640px) {
  .metrics-grid,
  .catalog-grid,
  .form-grid,
  .installed-grid {
    grid-template-columns: 1fr;
  }

  .launcher-page {
    width: min(100% - 24px, 1180px);
    padding-top: 12px;
  }

  .launcher-header,
  .market-toolbar,
  .my-apps-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .launcher-nav {
    width: 100%;
    overflow-x: auto;
  }

  .launcher-hero {
    min-height: auto;
    padding-top: 24px;
  }

  .hero-copy h2,
  .my-apps-hero h2 {
    font-size: 34px;
  }

  .hero-preview {
    min-height: 260px;
    padding: 16px;
  }

  .section-toolbar,
  .app-toolbar,
  .topbar-actions,
  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    overflow-x: auto;
  }

  .metric strong {
    font-size: 22px;
  }

  th,
  td {
    padding: 11px 12px;
  }
}
