:root {
  --font-ar: 'Cairo', 'Tajawal', sans-serif;
  --font-latin: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html[dir='rtl'] body {
  font-family: var(--font-ar);
}

html[dir='ltr'] body {
  font-family: var(--font-latin);
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Studio transparency checkerboard grid (Light & Dark variants) */
.studio-checkerboard {
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
    linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.dark .studio-checkerboard {
  background-color: #0f172a;
  background-image:
    linear-gradient(45deg, #1e293b 25%, transparent 25%),
    linear-gradient(-45deg, #1e293b 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1e293b 75%),
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
}

/* Tactile frosted panel surface (Light & Dark variants) */
.frosted-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.dark .frosted-panel {
  background: rgba(15, 23, 42, 0.88);
}

/* Custom sleek range sliders (Touch-friendly thumb on mobile) */
input[type='range'].studio-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  outline: none;
  touch-action: pan-y;
}

.dark input[type='range'].studio-slider {
  background: #334155;
}

input[type='range'].studio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0d9488;
  border: 2.5px solid #ffffff;
  box-shadow: 0 1px 5px rgba(17, 24, 39, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

@media (min-width: 1024px) {
  input[type='range'].studio-slider::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }
}

input[type='range'].studio-slider::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

input[type='range'].studio-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0d9488;
  border: 2.5px solid #ffffff;
  box-shadow: 0 1px 5px rgba(17, 24, 39, 0.3);
  cursor: pointer;
}

/* Clean custom scrollbars inside studio panels */
.studio-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.studio-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.studio-scroll::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.dark .studio-scroll::-webkit-scrollbar-thumb {
  background: #334155;
}

.studio-scroll::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Hide horizontal scrollbar cleanly on mobile tool tab strips */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Standalone Legal & CMS Page Typography */
.legal-rich-content h2 {
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.45rem;
}

.dark .legal-rich-content h2 {
  color: #f8fafc;
}

.legal-rich-content h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.35rem;
}

.dark .legal-rich-content h3 {
  color: #e2e8f0;
}

.legal-rich-content p {
  margin-bottom: 0.75rem;
}

.legal-rich-content ul,
.legal-rich-content ol {
  margin-bottom: 0.75rem;
  padding-inline-start: 1.25rem;
  list-style-type: disc;
}

.legal-rich-content li {
  margin-bottom: 0.3rem;
}

.legal-rich-content a {
  color: #0d9488;
  font-weight: 600;
  text-decoration: underline;
}

.dark .legal-rich-content a {
  color: #2dd4bf;
}
