:root {
  --bg: #faf9f7;
  --bg-card: #ffffff;
  --text: #1f1830;
  --text-muted: #6b6480;
  --border: #ece8f0;
  --primary: #a21caf;
  --primary-soft: #f5e8fb;
  --accent: #6d28d9;
  --code-bg: #f4f1f8;
}
.dark {
  --bg: #14101c;
  --bg-card: #1e1830;
  --text: #f0ebf7;
  --text-muted: #a89cc0;
  --border: #2c2440;
  --primary: #d946ef;
  --primary-soft: #2a1836;
  --accent: #a78bfa;
  --code-bg: #241c38;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  background-image: radial-gradient(circle at 90% 5%, var(--primary-soft) 0%, transparent 35%),
                    radial-gradient(circle at 5% 95%, var(--primary-soft) 0%, transparent 40%);
  background-attachment: fixed;
}

.header-bar {
  background: color-mix(in srgb, var(--bg-card) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand-title {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-link { color: var(--primary); text-decoration: none; }
.brand-link:hover { text-decoration: underline; }
.footer-bar { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-card) 60%, transparent); }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 4px 20px -8px rgba(0,0,0,.12); }

/* Buttons */
.icon-btn { width: 2.4rem; height: 2.4rem; border-radius: .75rem; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 1.1rem; cursor: pointer; transition: .15s; display:flex;align-items:center;justify-content:center; }
.icon-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.btn-secondary { padding: .5rem .9rem; border-radius: .75rem; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer; font-weight: 600; transition: .15s; white-space: nowrap; }
.btn-secondary:hover { border-color: var(--primary); }
.btn-primary { padding: .55rem 1rem; border-radius: .75rem; border: none; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; cursor: pointer; font-weight: 700; transition: .15s; box-shadow: 0 4px 14px -4px var(--primary); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-ghost { background: none; border: none; color: var(--primary); cursor: pointer; font-weight: 600; }
.btn-hero { padding: .7rem 1.4rem; border-radius: .9rem; border: none; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; cursor: pointer; font-weight: 800; font-size: 1rem; box-shadow: 0 6px 20px -6px var(--primary); transition: .15s; }
.btn-hero:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); }
.mini-btn { padding: .25rem .55rem; border-radius: .55rem; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer; font-size: .8rem; transition: .15s; }
.mini-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.badge-count { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 0 .4rem; font-size: .7rem; font-weight: 800; margin-right: .25rem; }

/* Drop zone */
.drop-zone { border: 2.5px dashed var(--border); border-radius: 1.25rem; padding: 3rem 1.5rem; text-align: center; cursor: pointer; transition: .2s; background: var(--bg-card); }
.drop-zone:hover, .drop-active { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.01); }
.fmt-pill { background: var(--code-bg); color: var(--text-muted); padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.fmt-pill-sm { background: var(--primary-soft); color: var(--primary); padding: .1rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700; }

.mascot { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Project card */
.proj-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 1rem; padding: 1rem; cursor: pointer; transition: .15s; }
.proj-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 24px -10px var(--primary); }

/* Progress */
.progress-track { height: 8px; background: var(--code-bg); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width .4s ease; }

/* Search */
.search-input { padding: .6rem .9rem; border-radius: .75rem; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-family: inherit; outline: none; transition: .15s; }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* Translation table */
.trans-head { grid-template-columns: 1.2fr 2fr 2fr .8fr; gap: 1rem; padding: .75rem 1rem; font-weight: 800; font-size: .8rem; color: var(--text-muted); background: var(--code-bg); }
.trans-row { display: grid; grid-template-columns: 1.2fr 2fr 2fr .8fr; gap: 1rem; padding: .85rem 1rem; align-items: start; transition: .1s; }
.trans-row:nth-child(even) { background: color-mix(in srgb, var(--code-bg) 40%, transparent); }
.trans-row:hover { background: var(--primary-soft); }
@media (max-width: 768px) {
  .trans-row { grid-template-columns: 1fr; gap: .4rem; border-bottom: 1px solid var(--border); }
  .trans-key::before { content: 'کلید: '; color: var(--text-muted); }
  .trans-orig::before { content: 'اصلی: '; color: var(--text-muted); font-family: 'Vazirmatn'; }
}
.trans-key { font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: var(--text-muted); word-break: break-all; }
.trans-orig { font-size: .9rem; word-break: break-word; }
.trans-input { width: 100%; padding: .5rem .65rem; border-radius: .6rem; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; resize: none; outline: none; overflow: hidden; min-height: 2.4rem; transition: .15s; }
.trans-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.ph-token { background: rgba(217,70,239,.18); color: var(--primary); padding: 0 .2rem; border-radius: .3rem; font-family: 'JetBrains Mono', monospace; font-size: .82em; font-weight: 700; }
.warn-ph { color: #f59e0b; font-size: .72rem; margin-top: .25rem; font-family: 'JetBrains Mono', monospace; }

/* Status chips */
.status-chip { padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.st-todo { background: #f3f4f6; color: #6b7280; }
.dark .st-todo { background: #2c2440; color: #a89cc0; }
.st-prog { background: #dbeafe; color: #2563eb; animation: pulse 1.2s infinite; }
.st-done { background: #dcfce7; color: #16a34a; }
.st-edit { background: #fef3c7; color: #d97706; }
@keyframes pulse { 50% { opacity: .5; } }

/* Drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; animation: fade .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 90%; max-width: 380px; background: var(--bg); border-left: 1px solid var(--border); padding: 1.25rem; overflow-y: auto; animation: slideIn .25s ease; }
@keyframes slideIn { from { transform: translateX(100%); } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 45; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fade .2s; }
.modal { background: var(--bg); border: 1px solid var(--border); border-radius: 1.25rem; padding: 1.5rem; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; animation: pop .25s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

/* Compat */
.score-ring { width: 130px; height: 130px; margin: 0 auto; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--code-bg) 0); display: flex; align-items: center; justify-content: center; }
.score-inner { width: 100px; height: 100px; border-radius: 50%; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.compat-item { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem; border: 1px solid var(--border); border-radius: .8rem; background: var(--bg-card); }

/* Versions */
.version-item { border: 1px solid var(--border); border-radius: .8rem; padding: .85rem; background: var(--bg-card); }

/* Toast */
.toast { padding: .7rem 1.1rem; border-radius: .8rem; font-weight: 700; font-size: .88rem; box-shadow: 0 8px 24px -6px rgba(0,0,0,.3); animation: toastIn .3s ease; text-align: center; max-width: 100%; }
.toast-info { background: var(--accent); color: #fff; }
.toast-success { background: #16a34a; color: #fff; }
.toast-error { background: #dc2626; color: #fff; }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } }

/* Confetti */
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .3; } }

/* Stagger reveal */
.stagger > * { animation: revealUp .5s ease backwards; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .12s; }
.stagger > *:nth-child(3) { animation-delay: .19s; }
.stagger > *:nth-child(4) { animation-delay: .26s; }
@keyframes revealUp { from { opacity: 0; transform: translateY(12px); } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
.hidden { display: none; }
</parameter>
</invoke>