:root {
  --sx-color-page: #f7f7fb;
  --sx-color-surface: #ffffff;
  --sx-color-text: #171427;
  --sx-color-muted: #5f6172;
  --sx-color-border: #ddddec;
  --sx-color-brand: #6149f2;
  --sx-color-brand-strong: #4b35d6;
  --sx-color-accent: #087f5b;
  --sx-color-danger: #b42318;
  --sx-color-focus: #f4b400;
  --sx-radius-sm: 0.45rem;
  --sx-radius-md: 0.5rem;
  --sx-space-1: 0.25rem;
  --sx-space-2: 0.5rem;
  --sx-space-3: 0.75rem;
  --sx-space-4: 1rem;
  --sx-space-6: 1.5rem;
  --sx-shell: 1120px;
}

[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .site-nav,
[dir="rtl"] .home-hero__actions,
[dir="rtl"] .hero-shell__actions,
[dir="rtl"] .contact-form__actions,
[dir="rtl"] .site-footer__links {
  direction: rtl;
}

.button,
.site-nav__link,
.blog-filter__tag,
.sx-chip {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover:not([aria-disabled="true"]):not(:disabled),
.site-nav__link:hover,
.blog-filter__tag:hover {
  transform: translateY(-1px);
}

.button[aria-disabled="true"],
.button:disabled,
.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.button[aria-busy="true"]::after,
.sx-status[aria-busy="true"]::before,
.sx-media[data-state="loading"]::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-block-start-color: transparent;
  border-radius: 999px;
  margin-inline-start: 0.5rem;
  animation: sx-spin 800ms linear infinite;
}

.sx-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sx-space-3);
  border: 1px solid var(--sx-color-border);
  border-radius: var(--sx-radius-md);
  background: var(--sx-color-surface);
  color: var(--sx-color-muted);
  padding: var(--sx-space-4);
  min-width: 0;
  overflow-wrap: anywhere;
}

.sx-status[data-tone="error"] {
  border-color: #f0c6c0;
  background: #fff4f2;
  color: var(--sx-color-danger);
}

.sx-empty {
  border: 1px dashed var(--sx-color-border);
  border-radius: var(--sx-radius-md);
  background: var(--sx-color-surface);
  color: var(--sx-color-muted);
  padding: var(--sx-space-6);
  text-align: center;
}

.sx-media {
  display: grid;
  min-height: 12rem;
  place-items: center;
  border: 1px solid var(--sx-color-border);
  border-radius: var(--sx-radius-md);
  background: linear-gradient(135deg, #ffffff 0%, #eef4f1 100%);
  color: var(--sx-color-text);
  padding: var(--sx-space-6);
  overflow: hidden;
}

.sx-media img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.sx-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--sx-color-border);
  border-radius: var(--sx-radius-md);
  background: var(--sx-color-surface);
}

.sx-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  color: var(--sx-color-text);
}

.sx-table th,
.sx-table td {
  border-bottom: 1px solid var(--sx-color-border);
  padding: var(--sx-space-3) var(--sx-space-4);
  text-align: start;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.sx-table th {
  color: var(--sx-color-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.sx-table tr:last-child td {
  border-bottom: 0;
}

.sx-component-lab {
  display: grid;
  gap: var(--sx-space-6);
  padding-block: 3rem 4rem;
}

.sx-component-lab__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sx-space-4);
}

.sx-component-sample {
  min-width: 0;
  border: 1px solid var(--sx-color-border);
  border-radius: var(--sx-radius-md);
  background: var(--sx-color-surface);
  padding: var(--sx-space-6);
}

.sx-component-sample h2,
.sx-component-sample h3 {
  margin-top: 0;
}

.sx-component-lab .section-heading h2 {
  max-width: 100%;
  overflow-wrap: break-word;
}

@keyframes sx-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 860px) {
  .sx-component-lab__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .sx-component-sample,
  .sx-status,
  .sx-empty,
  .sx-media {
    max-width: calc(100vw - 1rem);
  }

  .sx-component-lab .section-heading h2 {
    font-size: 1.85rem;
    max-width: 11ch;
  }

  .sx-table {
    min-width: 36rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .site-nav__link,
  .blog-filter__tag,
  .sx-chip {
    transition: none;
  }

  .button:hover:not([aria-disabled="true"]):not(:disabled),
  .site-nav__link:hover,
  .blog-filter__tag:hover {
    transform: none;
  }

  .button[aria-busy="true"]::after,
  .sx-status[aria-busy="true"]::before,
  .sx-media[data-state="loading"]::before {
    animation: none;
  }
}
