[hidden] { display: none !important; }

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/assets/fonts/ibm-plex-arabic-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/assets/fonts/ibm-plex-arabic-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/assets/fonts/ibm-plex-arabic-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #07080b;
  --bg-2: #0a0c11;
  --panel: #10131a;
  --panel-2: #151923;
  --panel-3: #1b202b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --ink: #f6f7f2;
  --muted: #8e95a3;
  --faint: #5b6270;
  --acc: #d6ff4b;
  --acc-ink: #08090c;
  --acc-2: #8a7cff;
  --warm: #ff8a5c;
  --danger: #ff6b6b;
  --ok: #6ee7a8;
  --radius: 18px;
  --radius-sm: 12px;
  --font: "IBM Plex Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans Arabic", sans-serif;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--acc);
  color: var(--acc-ink);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #262c38;
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: #38404f;
}

.mono {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 12px rgba(214, 255, 75, 0.8);
}

.pill.warn .dot {
  background: var(--warm);
  box-shadow: 0 0 12px rgba(255, 138, 92, 0.8);
}

.pill.bad .dot {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(255, 107, 107, 0.8);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  user-select: none;
}

.logo img {
  width: 34px;
  height: 34px;
}

.logo .word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.16em;
  line-height: 1;
}

.logo .sub {
  display: block;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  margin-top: 5px;
}

.btn {
  --btn-bg: var(--panel-2);
  --btn-ink: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--line-strong);
  background: var(--panel-3);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn-primary {
  --btn-bg: var(--acc);
  --btn-ink: var(--acc-ink);
  border-color: transparent;
  box-shadow: 0 8px 28px rgba(214, 255, 75, 0.14);
}

.btn-primary:hover {
  background: #e2ff78;
  border-color: transparent;
}

.btn-outline {
  background: transparent;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-color: transparent;
}

.btn-danger {
  color: var(--danger);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 24px;
  font-size: 15.5px;
  border-radius: 14px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--muted);
  transition: 0.16s ease;
}

.icon-btn:hover {
  color: var(--ink);
  background: var(--panel-3);
  border-color: var(--line-strong);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > label,
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field .hint {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.5;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  padding: 9px 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(214, 255, 75, 0.5);
  background: #0c0f15;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(0% + 16px) calc(50% + 1px), calc(0% + 21px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-left: 34px;
}

.textarea {
  resize: vertical;
  min-height: 74px;
  line-height: 1.7;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  appearance: none;
  background: linear-gradient(90deg, var(--acc) var(--range, 50%), #252b37 var(--range, 50%));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--acc);
  box-shadow: 0 0 0 4px rgba(214, 255, 75, 0.1);
  cursor: grab;
}

input[type="color"] {
  appearance: none;
  width: 38px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 3px;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 40px;
  height: 23px;
  border-radius: 99px;
  background: #262c38;
  border: 1px solid var(--line);
  transition: 0.18s ease;
  flex: 0 0 auto;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--muted);
  transition: 0.18s ease;
}

.switch.on {
  background: rgba(214, 255, 75, 0.16);
  border-color: rgba(214, 255, 75, 0.5);
}

.switch.on::after {
  right: 19px;
  background: var(--acc);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.switch-row span {
  font-size: 13px;
  font-weight: 600;
}

.switch-row small {
  display: block;
  font-size: 11px;
  color: var(--faint);
  font-weight: 400;
  margin-top: 2px;
}

.seg {
  display: flex;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}

.seg button {
  flex: 1;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 6px 7px;
  font-size: 11.5px;
  font-weight: 600;
  transition: 0.15s ease;
}

.seg button.active {
  background: var(--panel-3);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.toast-wrap {
  position: fixed;
  bottom: 22px;
  left: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 1200;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(20, 24, 32, 0.96);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  max-width: 380px;
  animation: toast-in 0.22s ease both;
  backdrop-filter: blur(14px);
}

.toast.ok {
  border-color: rgba(110, 231, 168, 0.3);
}
.toast.err {
  border-color: rgba(255, 107, 107, 0.35);
}
.toast .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acc);
  flex: 0 0 auto;
}
.toast.err .dot {
  background: var(--danger);
}
.toast.ok .dot {
  background: var(--ok);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--acc);
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress {
  height: 6px;
  border-radius: 99px;
  background: #20252f;
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--acc), #f0ff9a);
  transition: width 0.35s ease;
  box-shadow: 0 0 14px rgba(214, 255, 75, 0.5);
}

.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;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel-2);
  font-family: var(--display);
  font-size: 10px;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
