/* Generated by scripts/split_css.py — prefer editing this file, then keep surfaces in sync. */
/* Shared: tokens, brand, buttons, toast, forms, username/charcount, rise */

:root {
  /* Lilac · grape purple · blue scale */
  --ink: #1a1228;
  --paper: #f5f0fa;
  --muted: #6b6280;
  --accent: #7b3fa0;
  --accent-soft: #9b6bc9;
  --accent-deep: #4a2170;
  --blue: #3b6fe8;
  --blue-soft: #6b8ff0;
  --lilac: #dcc9f0;
  --danger: #c4456a;
  --surface: rgba(255, 255, 255, 0.9);
  --line: rgba(74, 33, 112, 0.12);
  --shadow: 0 18px 50px rgba(40, 20, 70, 0.14);
  --radius: 18px;
  --font: "Vazirmatn", sans-serif;
  --sidebar-w: 15.5rem;
  --dash-bottom-nav-h: 0px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--blue);
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
  font-weight: 750;
}

.lede {
  color: var(--muted);
  margin: 0.35rem 0 0;
  max-width: 40rem;
  font-size: 0.95rem;
  font-weight: 450;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.brand-mark {
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  color: var(--accent-deep);
  background: linear-gradient(120deg, var(--accent-deep), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-logo {
  display: block;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-logo-sm {
  width: 1.15rem;
  height: 1.15rem;
}

.brand-logo-hero {
  width: clamp(3.2rem, 8vw, 4.5rem);
  height: clamp(3.2rem, 8vw, 4.5rem);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.45rem;
  margin: 0;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--accent-deep);
  -webkit-text-fill-color: currentColor;
}

.brand-link .brand-logo {
  width: 2.1rem;
  height: 2.1rem;
}

.brand-link span {
  background: linear-gradient(120deg, var(--accent-deep), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.btn-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font: inherit;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--blue) 100%);
  box-shadow: 0 10px 22px rgba(123, 63, 160, 0.28);
  border: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-view svg {
  width: 1.05rem;
  height: 1.05rem;
}

.btn-view:hover,
a.btn-view:hover {
  color: #fff;
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.dash-header .btn-view {
  flex-shrink: 0;
  width: fit-content;
  padding: 0.65rem 1.1rem;
  font-size: 0.9rem;
}

.toast-host {
  position: fixed;
  top: calc(0.85rem + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: grid;
  gap: 0.55rem;
  width: min(92vw, 22.5rem);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.85rem 0.85rem 1rem;
  border-radius: 16px;
  color: #fff;
  background: rgba(26, 18, 40, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 40px rgba(20, 10, 40, 0.28);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.is-out {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.toast-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.55;
  color: #fff;
}

.toast-close {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.toast-close svg {
  width: 0.85rem;
  height: 0.85rem;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.toast-success {
  background: linear-gradient(135deg, rgba(74, 33, 112, 0.94), rgba(45, 70, 150, 0.92));
  border-color: rgba(220, 201, 240, 0.28);
}

.toast-error {
  background: linear-gradient(135deg, rgba(140, 40, 70, 0.95), rgba(90, 30, 55, 0.92));
  border-color: rgba(255, 180, 200, 0.25);
}

.toast-warning {
  background: linear-gradient(135deg, rgba(120, 80, 20, 0.94), rgba(90, 55, 15, 0.92));
  border-color: rgba(255, 220, 160, 0.25);
}

.toast-info {
  background: linear-gradient(135deg, rgba(40, 55, 110, 0.94), rgba(30, 40, 90, 0.92));
  border-color: rgba(180, 200, 255, 0.25);
}

.btn-primary,
a.btn-primary,
button.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--blue) 100%);
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 10px 24px rgba(123, 63, 160, 0.3);
}

.btn-primary:hover,
.btn-primary:focus-visible,
a.btn-primary:hover,
a.btn-primary:focus-visible,
button.btn-primary:hover,
button.btn-primary:focus-visible {
  filter: brightness(1.05);
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.btn-ghost,
a.btn-ghost,
button.btn-ghost {
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent-deep);
  border: 1px solid rgba(74, 33, 112, 0.2);
  box-shadow: 0 1px 2px rgba(40, 20, 70, 0.04);
}

.btn-ghost:hover,
a.btn-ghost:hover,
button.btn-ghost:hover {
  color: var(--accent-deep);
  background: rgba(245, 240, 250, 0.98);
  border-color: rgba(123, 63, 160, 0.42);
  box-shadow: 0 4px 12px rgba(123, 63, 160, 0.1);
}

.btn-copy,
a.btn-copy,
button.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(123, 63, 160, 0.28);
  background: linear-gradient(180deg, #fff, rgba(245, 240, 250, 0.95));
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(40, 20, 70, 0.05);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-copy svg {
  width: 0.95rem;
  height: 0.95rem;
}

.btn-copy:hover,
.btn-copy.is-copied,
a.btn-copy:hover,
button.btn-copy:hover,
button.btn-copy.is-copied {
  border-color: rgba(123, 63, 160, 0.5);
  background: linear-gradient(135deg, rgba(220, 201, 240, 0.7), rgba(180, 200, 255, 0.45));
  color: var(--accent-deep);
  box-shadow: 0 4px 12px rgba(123, 63, 160, 0.12);
}

.btn-danger,
a.btn-danger,
button.btn-danger {
  background: #fff5f7;
  color: var(--danger);
  border: 1px solid rgba(196, 69, 106, 0.28);
  box-shadow: none;
}

.btn-danger:hover,
a.btn-danger:hover,
button.btn-danger:hover {
  background: #ffe8ee;
  color: #a83255;
  border-color: rgba(196, 69, 106, 0.45);
}

.btn-danger svg {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
}

.btn-text {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.icon-md {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-lg {
  width: 1.75rem;
  height: 1.75rem;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.field input,
.field textarea,
.field select,
.stack-form input,
.stack-form textarea,
.stack-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.72rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 450;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus {
  border-color: rgba(123, 63, 160, 0.45);
  box-shadow: 0 0 0 3px rgba(123, 63, 160, 0.12);
  outline: none;
}

.field small,
.help-clear {
  color: var(--muted);
  font-weight: 450;
  font-size: 0.82rem;
  line-height: 1.55;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.85rem;
  align-items: end;
}

.field-check {
  min-width: 12rem;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.7rem;
  padding: 0 0.2rem;
  font-weight: 550;
  font-size: 0.88rem;
}

.check-line input {
  width: auto;
}

.field input[type="color"] {
  padding: 0.25rem;
  height: 2.75rem;
  cursor: pointer;
}

.field input[type="checkbox"] {
  width: auto;
  justify-self: start;
}

.error {
  color: var(--danger);
  font-style: normal;
  font-size: 0.85rem;
}

.form-errors {
  display: grid;
  gap: 0.25rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.char-count {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  flex: 0 0 auto;
}

.field.is-near-limit .char-count {
  color: #b45309;
}

.field.is-at-limit .char-count {
  color: #b42318;
}

.field.is-over-limit .char-count {
  color: #b42318;
  font-weight: 800;
}

.field.is-over-limit input,
.field.is-over-limit textarea,
.field.is-over-limit select {
  border-color: rgba(180, 35, 24, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.field.is-over-limit:focus-within input,
.field.is-over-limit:focus-within textarea {
  border-color: rgba(180, 35, 24, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16);
}

.username-field {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 0.65rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.username-field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 50%, white);
  box-shadow: 0 0 0 3px rgba(123, 63, 160, 0.12);
}

.username-field.is-invalid,
.username-field.is-invalid:focus-within {
  border-color: rgba(196, 69, 106, 0.75);
  box-shadow: 0 0 0 3px rgba(196, 69, 106, 0.16);
}

.username-field.is-valid,
.username-field.is-valid:focus-within {
  border-color: rgba(46, 140, 110, 0.65);
  box-shadow: 0 0 0 3px rgba(46, 140, 110, 0.14);
}

.username-field.is-checking {
  border-color: color-mix(in srgb, var(--blue) 45%, white);
}

.username-live-error {
  display: block;
  margin-top: 0.25rem;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}

.username-live-error[hidden] {
  display: none !important;
}

.username-prefix,
.username-suffix {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  flex-shrink: 0;
}

.username-field input,
.field .username-input {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-inline: 0.2rem !important;
  min-width: 0;
  flex: 1;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ——— Error pages (404) ——— */

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

.page-error {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 85% 65% at 10% 12%, rgba(123, 63, 160, 0.22), transparent 58%),
    radial-gradient(ellipse 70% 55% at 92% 88%, rgba(59, 111, 232, 0.18), transparent 55%),
    linear-gradient(165deg, #efe6f8 0%, #f7f4fc 45%, #e8eefb 100%);
  color: var(--ink);
  overflow-x: clip;
}

.error-shell {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(1.75rem, 4vw, 2.75rem);
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    calc(1.5rem + env(safe-area-inset-top, 0px))
    clamp(1.15rem, 4vw, 2rem)
    calc(2rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.error-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.error-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
}

.error-orb-a {
  width: min(52vw, 28rem);
  height: min(52vw, 28rem);
  top: -12%;
  left: 55%;
  background: radial-gradient(circle, rgba(123, 63, 160, 0.38), transparent 70%);
  animation: error-drift 16s ease-in-out infinite alternate;
}

.error-orb-b {
  width: min(40vw, 20rem);
  height: min(40vw, 20rem);
  bottom: 4%;
  left: -6%;
  background: radial-gradient(circle, rgba(59, 111, 232, 0.3), transparent 70%);
  animation: error-drift 12s ease-in-out infinite alternate-reverse;
}

.error-orb-c {
  width: min(26vw, 13rem);
  height: min(26vw, 13rem);
  top: 48%;
  left: 22%;
  background: radial-gradient(circle, rgba(155, 107, 201, 0.28), transparent 70%);
  animation: error-drift 14s ease-in-out infinite alternate;
}

.error-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(74, 33, 112, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 33, 112, 0.045) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}

.error-brand {
  position: relative;
  z-index: 1;
  animation: rise 0.55s ease both;
}

.error-panel {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  width: min(100%, 34rem);
  animation: rise 0.7s ease 0.08s both;
}

.error-eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.error-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.35rem, 2vw, 0.75rem);
  margin: 0.15rem 0 0.35rem;
  user-select: none;
}

.error-digit {
  font-size: clamp(4.5rem, 18vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.9;
  background: linear-gradient(135deg, var(--accent-deep) 10%, var(--accent) 45%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  animation: error-bob 5.5s ease-in-out infinite;
}

.error-digit:last-child {
  animation-delay: -2.75s;
}

.error-infinity {
  display: grid;
  place-items: center;
  width: clamp(3.6rem, 12vw, 5rem);
  height: clamp(3.6rem, 12vw, 5rem);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(220, 201, 240, 0.55));
  border: 1px solid rgba(74, 33, 112, 0.12);
  box-shadow:
    0 14px 36px rgba(40, 20, 70, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  animation: error-glow 4.8s ease-in-out infinite;
}

.error-infinity img {
  width: 58%;
  height: 58%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(74, 33, 112, 0.18));
}

.error-panel h1 {
  margin: 0;
  font-size: clamp(1.45rem, 4.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
  max-width: 18ch;
}

.error-lede {
  margin: 0;
  max-width: 32rem;
  font-size: 0.98rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.65rem;
  width: 100%;
}

.error-actions .btn {
  min-width: 10.5rem;
}

.error-hint {
  margin: 1.1rem 0 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.7;
}

.error-hint-path {
  display: inline-block;
  margin-inline-start: 0.15rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  direction: ltr;
  unicode-bidi: isolate;
}

@keyframes error-drift {
  from {
    transform: translate(-3%, 0) scale(1);
  }
  to {
    transform: translate(4%, 6%) scale(1.06);
  }
}

@keyframes error-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes error-glow {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 14px 36px rgba(40, 20, 70, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.85);
  }
  50% {
    transform: translateY(-4px) scale(1.04);
    box-shadow:
      0 18px 40px rgba(59, 111, 232, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
}

@media (max-width: 520px) {
  .error-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .error-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-orb-a,
  .error-orb-b,
  .error-orb-c,
  .error-digit,
  .error-infinity,
  .error-brand,
  .error-panel {
    animation: none !important;
  }
}
