/* ==========================================================================
   ABCTools — Design system v2
   Logical properties everywhere so RTL (Arabic) and LTR (English) both work.
   ========================================================================== */
:root {
  --bg: #f5f6fb;
  --bg-2: #eceffa;
  --surface: #ffffff;
  --surface-2: #f7f8fd;
  --surface-3: #eef1fa;
  --glass: rgba(255, 255, 255, .72);
  --border: rgba(15, 23, 42, .08);
  --border-2: rgba(15, 23, 42, .14);
  --text: #0b1020;
  --text-2: #3d4660;
  --muted: #6b7390;
  --brand: #6d28d9;
  --brand-2: #4f46e5;
  --accent: #0891b2;
  --brand-soft: rgba(99, 102, 241, .10);
  --grad: linear-gradient(120deg, #7c3aed 0%, #4f46e5 45%, #0ea5e9 100%);
  --grad-warm: linear-gradient(120deg, #f97316, #ec4899);
  --success: #059669; --success-soft: rgba(5, 150, 105, .1);
  --danger: #e11d48;  --danger-soft: rgba(225, 29, 72, .1);
  --warn: #d97706;    --warn-soft: rgba(217, 119, 6, .12);
  --radius: 20px; --radius-sm: 13px; --radius-xs: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 10px 30px -12px rgba(30, 27, 75, .18), 0 2px 6px rgba(16, 24, 40, .04);
  --shadow-lg: 0 30px 60px -20px rgba(49, 46, 129, .35);
  --ring: 0 0 0 4px rgba(99, 102, 241, .2);
  --font-ar: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-en: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1200px;
  --header-h: 68px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #07080f;
  --bg-2: #0d0f1c;
  --surface: #11131f;
  --surface-2: #161927;
  --surface-3: #1c2032;
  --glass: rgba(17, 19, 31, .72);
  --border: rgba(255, 255, 255, .08);
  --border-2: rgba(255, 255, 255, .15);
  --text: #eef0fb;
  --text-2: #b9bfd8;
  --muted: #8a91ad;
  --brand: #a78bfa;
  --brand-2: #818cf8;
  --accent: #22d3ee;
  --brand-soft: rgba(129, 140, 248, .14);
  --success: #34d399; --success-soft: rgba(52, 211, 153, .12);
  --danger: #fb7185;  --danger-soft: rgba(251, 113, 133, .12);
  --warn: #fbbf24;    --warn-soft: rgba(251, 191, 36, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  --ring: 0 0 0 4px rgba(129, 140, 248, .28);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font-en); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.85; }
img, svg, canvas, video { max-width: 100%; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .6em; letter-spacing: -.01em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }
::selection { background: rgba(124, 58, 237, .25); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 200; background: var(--surface); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); }
.skip:focus { top: 12px; }

/* ---------- Aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora::before, .aurora::after, .aurora i {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora::before { width: 46vmax; height: 46vmax; top: -18vmax; inset-inline-start: -10vmax; background: radial-gradient(circle, #a78bfa 0%, transparent 65%); }
.aurora::after { width: 40vmax; height: 40vmax; top: -12vmax; inset-inline-end: -14vmax; background: radial-gradient(circle, #67e8f9 0%, transparent 65%); animation-delay: -8s; }
.aurora i { width: 34vmax; height: 34vmax; top: 30vh; inset-inline-start: 30vw; background: radial-gradient(circle, #f9a8d4 0%, transparent 65%); opacity: .28; animation-delay: -16s; }
:root[data-theme="dark"] .aurora::before { opacity: .32; }
:root[data-theme="dark"] .aurora::after { opacity: .22; }
:root[data-theme="dark"] .aurora i { opacity: .12; }
.grid-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 30%, transparent 75%); opacity: .55; }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(6vw, 4vh, 0) scale(1.15); } }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
main { display: block; padding-bottom: 40px; }
.section { padding-block: 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); margin: 0; }
.section-head p { color: var(--muted); margin: 6px 0 0; }
.eyebrow { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: .85rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: var(--glass); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 8px 18px -6px rgba(79, 70, 229, .6); font-size: .82rem; font-weight: 800; letter-spacing: -.03em; font-family: var(--font-en); }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 18px; }
.nav > a, .nav > .dd > button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .94rem; background: none; border: 0; cursor: pointer; }
.nav > a:hover, .nav > .dd > button:hover, .nav > a[aria-current="page"] { background: var(--brand-soft); color: var(--text); text-decoration: none; }
.nav .ico { width: 16px; height: 16px; }
.dd { position: relative; }
.dd-panel { position: absolute; top: calc(100% + 10px); inset-inline-start: -40px; width: min(640px, 92vw); padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s ease; }
.dd.open .dd-panel, .dd:focus-within .dd-panel { opacity: 1; visibility: visible; transform: none; }
.dd-panel a { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; color: var(--text); }
.dd-panel a:hover { background: var(--surface-2); text-decoration: none; }
.dd-panel small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.dd-panel strong { font-size: .93rem; }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--border-2); transform: translateY(-1px); text-decoration: none; }
.icon-btn .ico { width: 20px; height: 20px; }
.search-trigger { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding-inline: 12px 8px; min-width: 210px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-size: .9rem; }
.search-trigger:hover { border-color: var(--border-2); }
.search-trigger .ico { width: 18px; height: 18px; }
.search-trigger kbd, .kbd { margin-inline-start: auto; font-family: var(--mono); font-size: .72rem; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }
.lang-link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding-inline: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: .88rem; }
.lang-link:hover { text-decoration: none; color: var(--text); border-color: var(--border-2); }
.lang-link .ico { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
.menu-btn { display: none; }
.mobile-nav { display: none; }

@media (max-width: 1000px) {
  .nav, .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .menu-btn { display: inline-grid; }
  .mobile-nav { position: fixed; inset: var(--header-h) 0 0 0; z-index: 49; background: var(--bg); padding: 18px 20px 40px; overflow-y: auto; }
  .mobile-nav.open { display: block; animation: fade .2s ease; }
  .mobile-nav a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: var(--text); font-weight: 600; }
  .mobile-nav a:hover { background: var(--surface); text-decoration: none; }
  .mobile-nav h4 { margin: 18px 12px 6px; color: var(--muted); font-size: .8rem; }
  .mobile-nav a > .ico { width: 22px; height: 22px; flex: none; color: var(--brand-2); }
  .mobile-nav a > .tile { flex: none; }
  .mobile-nav a[aria-current="page"] { background: var(--brand-soft); }
}
.menu-btn .i-close { display: none; }
.menu-btn[aria-expanded="true"] .i-open { display: none; }
.menu-btn[aria-expanded="true"] .i-close { display: block; }
@media (max-width: 420px) { .lang-link span { display: none; } .lang-link { width: 40px; justify-content: center; padding: 0; } }

/* ---------- Buttons & controls ---------- */
.btn { --b: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 13px; border: 1px solid var(--border-2); background: var(--b); color: var(--text); font-weight: 700; font-size: .95rem; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; white-space: nowrap; text-decoration: none !important; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--brand-2); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn .ico { width: 19px; height: 19px; }
.btn-primary { background: var(--grad); background-size: 140% 100%; color: #fff; border: 0; box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .75); }
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 14px 28px -10px rgba(79, 70, 229, .85); }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .86rem; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: .9rem; color: var(--text-2); }
.hint { font-size: .82rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 13px; border: 1.5px solid var(--border-2);
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; font-size: 1rem; }
.textarea { min-height: 170px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: var(--ring); }
.input.mono, .textarea.mono { font-family: var(--mono); font-size: .9rem; direction: ltr; text-align: left; }
.select { appearance: none; -webkit-appearance: none; padding-inline-end: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7390' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
html[dir="rtl"] .select { background-position: left 14px center; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group .addon { display: grid; place-items: center; padding-inline: 14px; border: 1.5px solid var(--border-2); border-inline-start: 0; border-start-end-radius: 13px; border-end-end-radius: 13px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .9rem; white-space: nowrap; }
input[type="range"] { width: 100%; accent-color: var(--brand-2); height: 28px; }
input[type="color"] { width: 48px; height: 48px; border: 1.5px solid var(--border-2); border-radius: 12px; padding: 4px; background: var(--surface); cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: .95rem; }
.check input { width: 20px; height: 20px; accent-color: var(--brand-2); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--border-2); position: relative; transition: .2s; cursor: pointer; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .2s; }
.switch input:checked { background: var(--brand-2); }
.switch input:checked::after { inset-inline-start: 21px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer; transition: .15s; }
.seg button:hover { color: var(--text); }
.seg button.on, .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } .grid-2 > .stack[style*=sticky] { position: static !important; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.prose table { display: block; max-width: 100%; overflow-x: auto; }
.prose pre, .prose code { overflow-wrap: anywhere; }
.prose pre { overflow-x: auto; white-space: pre-wrap; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 18px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.pad { padding: 24px; }
@media (max-width: 600px) { .pad { padding: 18px; } }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 26px; text-align: center; position: relative; }
.hero .pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: .86rem; font-weight: 600; color: var(--text-2); }
html[dir="rtl"] .hero .pill { padding: 6px 6px 6px 14px; }
.hero .pill b { background: var(--grad); color: #fff; padding: 2px 10px; border-radius: 99px; font-size: .78rem; }
.hero h1 { font-size: clamp(2.1rem, 5.6vw, 4rem); line-height: 1.12; margin: 22px auto 16px; max-width: 900px; font-weight: 800; letter-spacing: -.035em; }
html[lang="ar"] .hero h1 { line-height: 1.3; letter-spacing: 0; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(1.02rem, 1.8vw, 1.22rem); color: var(--text-2); max-width: 720px; margin: 0 auto 30px; }
.hero-search { max-width: 680px; margin: 0 auto; position: relative; }
.hero-search .ico.s { position: absolute; inset-inline-start: 22px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--muted); pointer-events: none; }
.hero-search input { width: 100%; height: 64px; padding-inline: 58px 120px; border-radius: 20px; border: 1.5px solid var(--border-2); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 1.06rem; transition: .2s; }
.hero-search input:focus { outline: none; border-color: var(--brand-2); box-shadow: var(--shadow-lg), var(--ring); }
.hero-search .kbd { position: absolute; inset-inline-end: 18px; top: 50%; transform: translateY(-50%); }
.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 26px; margin-top: 28px; color: var(--text-2); font-weight: 600; font-size: .92rem; }
.hero-stats span { display: inline-flex; align-items: center; gap: 8px; }
.hero-stats .ico { width: 20px; height: 20px; color: var(--success); }
.popular { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.popular a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: .87rem; font-weight: 600; transition: .15s; }
.popular a:hover { border-color: var(--brand-2); color: var(--text); text-decoration: none; transform: translateY(-1px); }
.popular .ico { width: 16px; height: 16px; color: var(--brand-2); }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: .9rem; cursor: pointer; transition: .15s; }
.chip:hover { color: var(--text); border-color: var(--border-2); text-decoration: none; }
.chip .ico { width: 18px; height: 18px; }
.chip .n { font-size: .74rem; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.on .n { background: rgba(255, 255, 255, .18); color: inherit; }

/* ---------- Tool cards ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; }
.tool-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s, border-color .22s; isolation: isolate; overflow: hidden; }
.tool-card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .25s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c1) 14%, transparent), transparent 60%); }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c1) 40%, var(--border)); text-decoration: none; }
.tool-card:hover::before { opacity: 1; }
.tool-card h3 { font-size: 1.04rem; margin: 4px 0 0; }
.tool-card p { color: var(--muted); font-size: .9rem; margin: 0; line-height: 1.6; }
.tool-card .go { position: absolute; top: 20px; inset-inline-end: 18px; width: 20px; height: 20px; color: var(--muted); opacity: 0; transform: translateX(-6px); transition: .2s; }
html[dir="rtl"] .tool-card .go { transform: translateX(6px) scaleX(-1); }
.tool-card:hover .go { opacity: 1; transform: none; }
html[dir="rtl"] .tool-card:hover .go { transform: scaleX(-1); }
.tool-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.tag { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.tag.new { background: var(--success-soft); color: var(--success); }
.tag.hot { background: var(--danger-soft); color: var(--danger); }
.tile { --c1: #6366f1; --c2: #0ea5e9; width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 15px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 20px -10px var(--c1), inset 0 1px 0 rgba(255, 255, 255, .25); }
.tile .ico { width: 27px; height: 27px; }
.tile.sm { width: 38px; height: 38px; border-radius: 11px; }
.tile.sm .ico { width: 21px; height: 21px; }
.tile.lg { width: 68px; height: 68px; border-radius: 20px; }
.tile.lg .ico { width: 38px; height: 38px; }
.fav-btn { position: absolute; z-index: 2; bottom: 16px; inset-inline-end: 14px; width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: .15s; }
.tool-card:hover .fav-btn, .fav-btn.on { opacity: 1; }
.fav-btn.on { color: #f59e0b; }
.fav-btn .ico { width: 19px; height: 19px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1.5px dashed var(--border-2); border-radius: var(--radius); }

/* ---------- Category cards (home) ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat-card { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: .2s; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.cat-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.cat-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.cat-card .n { font-size: .8rem; font-weight: 700; color: var(--brand-2); margin-top: 8px; display: inline-block; }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature .tile { margin-bottom: 14px; }
.feature h3 { font-size: 1.08rem; }
.feature p { color: var(--muted); margin: 0; font-size: .94rem; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step { position: relative; padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-2); font-weight: 800; margin-bottom: 14px; font-family: var(--font-en); }
.step h3 { font-size: 1.05rem; }
.step p { color: var(--muted); margin: 0; font-size: .94rem; }
.cta { position: relative; overflow: hidden; border-radius: 28px; padding: 48px 32px; text-align: center; color: #fff; background: var(--grad); box-shadow: var(--shadow-lg); }
.cta::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px circle at 20% 0%, rgba(255, 255, 255, .25), transparent 50%); pointer-events: none; }
.cta h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.cta p { opacity: .9; max-width: 620px; margin: 0 auto 22px; }
.cta .btn { background: #fff; color: #312e81; border: 0; }

/* ---------- Breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); padding: 22px 0 0; margin: 0; list-style: none; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: .5; }

/* ---------- Tool page ---------- */
.tool-hero { display: flex; gap: 18px; align-items: flex-start; padding: 22px 0 22px; }
.tool-hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.35rem); margin: 0 0 8px; font-weight: 800; }
.tool-hero .lead { color: var(--text-2); font-size: 1.04rem; margin: 0 0 12px; max-width: 760px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 5px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.badge .ico { width: 15px; height: 15px; color: var(--success); }
.tool-hero .actions { margin-inline-start: auto; display: flex; gap: 8px; }
@media (max-width: 700px) { .tool-hero { flex-wrap: wrap; } .tool-hero .actions { margin-inline-start: 0; width: 100%; } }
.tool-panel { padding: 26px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; }
@media (max-width: 600px) { .tool-panel { padding: 16px; border-radius: 20px; } }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; margin-top: 34px; }
@media (max-width: 1000px) { .tool-layout { grid-template-columns: minmax(0, 1fr); } .aside { order: 2; } }
.aside { position: sticky; top: calc(var(--header-h) + 18px); display: flex; flex-direction: column; gap: 16px; }
.aside .card { padding: 18px; }
.aside h3 { font-size: .95rem; margin: 0 0 10px; }
.toc { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.toc a { display: block; padding: 6px 10px; border-radius: 9px; color: var(--text-2); border-inline-start: 2px solid transparent; }
.toc a:hover, .toc a.on { background: var(--surface-2); color: var(--text); text-decoration: none; border-inline-start-color: var(--brand-2); }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mini-list a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; color: var(--text); font-weight: 600; font-size: .9rem; }
.mini-list a:hover { background: var(--surface-2); text-decoration: none; }

/* drop zone */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; min-height: 210px; padding: 28px; border-radius: 20px; border: 2px dashed var(--border-2); background: var(--surface-2); cursor: pointer; transition: .2s; }
.drop:hover, .drop.over { border-color: var(--brand-2); background: var(--brand-soft); }
.drop .tile { margin-bottom: 4px; }
.drop strong { font-size: 1.08rem; }
.drop span { color: var(--muted); font-size: .9rem; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* results */
.result { padding: 22px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.result.good { background: var(--success-soft); border-color: transparent; }
.result.bad { background: var(--danger-soft); border-color: transparent; }
.result.warn { background: var(--warn-soft); border-color: transparent; }
.big-num { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; font-family: var(--font-en); }
html[lang="ar"] .big-num { font-family: var(--font-en), var(--font-ar); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.2; font-family: var(--font-en); word-break: break-word; }
.stat span { color: var(--muted); font-size: .84rem; font-weight: 600; }
.output { position: relative; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: .9rem; white-space: pre-wrap; word-break: break-all; max-height: 420px; overflow: auto; direction: ltr; text-align: left; }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 700; color: var(--text-2); font-size: .85rem; }
tr:last-child td { border-bottom: 0; }
.progress { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .3s; }
.alert { display: flex; gap: 10px; padding: 13px 16px; border-radius: 14px; font-size: .92rem; background: var(--brand-soft); color: var(--text-2); }
.alert.warn { background: var(--warn-soft); }
.alert .ico { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--brand-2); }
.hidden { display: none !important; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.file-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.file-item .size { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.file-item img, .file-item canvas { width: 44px; height: 44px; object-fit: cover; border-radius: 9px; background: var(--surface-3); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.thumb { position: relative; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-2); padding: 8px; text-align: center; cursor: pointer; transition: .15s; user-select: none; }
.thumb canvas, .thumb img { width: 100%; height: auto; border-radius: 6px; box-shadow: var(--shadow-sm); background: #fff; }
.thumb .pn { font-size: .8rem; font-weight: 700; color: var(--muted); margin-top: 6px; display: block; }
.thumb.off { opacity: .45; border-color: var(--danger); }
.thumb.off::after { content: "✕"; position: absolute; top: 8px; inset-inline-end: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center; font-size: .8rem; }

/* ---------- Prose (articles & tool guides) ---------- */
.prose { font-size: 1.04rem; color: var(--text-2); }
.prose > * + * { margin-top: 0; }
.prose h2 { color: var(--text); font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin: 2.1em 0 .7em; padding-top: .2em; }
.prose h3 { color: var(--text); font-size: 1.18rem; margin: 1.6em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--brand-2); font-weight: 700; }
.prose strong { color: var(--text); }
.prose blockquote { margin: 1.4em 0; padding: 16px 20px; border-inline-start: 4px solid var(--brand-2); background: var(--surface-2); border-radius: 0 14px 14px 0; }
html[dir="rtl"] .prose blockquote { border-radius: 14px 0 0 14px; }
.prose .note { padding: 16px 18px; border-radius: 16px; background: var(--brand-soft); margin: 1.4em 0; }
.prose table { margin: 1.2em 0; }
.prose code { font-family: var(--mono); font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); }
.prose a { font-weight: 600; }
.article-card { padding: 30px; }
@media (max-width: 600px) { .article-card { padding: 20px; } }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: .2s; }
.faq details[open] { box-shadow: var(--shadow-sm); border-color: var(--border-2); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 700; color: var(--text); display: flex; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-inline-start: auto; font-size: 1.4rem; font-weight: 400; color: var(--brand-2); transition: transform .2s; line-height: 1; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 20px 18px; color: var(--text-2); }
.faq .a p:last-child { margin: 0; }

/* blog */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.post-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.post-cover { aspect-ratio: 16/8; display: grid; place-items: center; color: #fff; position: relative; overflow: hidden; }
.post-cover .ico { width: 64px; height: 64px; opacity: .95; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .25)); }
.post-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at 80% 0%, rgba(255, 255, 255, .3), transparent 50%); }
.post-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-body h3 { font-size: 1.1rem; margin: 0; }
.post-body p { margin: 0; color: var(--muted); font-size: .92rem; }
.post-meta { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: auto; padding-top: 6px; }
.article-hero { padding: 26px 0 10px; max-width: 820px; }
.article-hero h1 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); font-weight: 800; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); background: var(--surface); }
.site-footer .wrap { padding-block: 46px 26px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: .9rem; margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--muted); font-size: .92rem; }
.site-footer a:hover { color: var(--text); }
.site-footer .about { color: var(--muted); font-size: .92rem; max-width: 340px; margin-top: 12px; }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(5, 8, 20, .45); backdrop-filter: blur(6px); }
.palette.open { display: flex; animation: fade .15s ease; }
.palette-box { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.palette-input .ico { width: 22px; height: 22px; color: var(--muted); }
.palette-input input { flex: 1; height: 62px; border: 0; background: transparent; font-size: 1.08rem; outline: none; }
.palette-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 8px; }
.palette-list a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; color: var(--text); }
.palette-list a.on, .palette-list a:hover { background: var(--brand-soft); text-decoration: none; }
.palette-list small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.palette-list .cat { margin-inline-start: auto; font-size: .74rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 120; bottom: 22px; inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-lg); animation: pop .25s ease; }
.toast.err { background: var(--danger); color: #fff; }

/* ---------- Consent ---------- */
.consent { position: fixed; z-index: 110; bottom: 18px; inset-inline-start: 18px; max-width: 440px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); animation: pop .35s ease; }
.consent p { font-size: .9rem; color: var(--text-2); margin-bottom: 14px; }
.consent h3 { font-size: 1rem; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
@media (max-width: 520px) { .consent { inset-inline: 10px; bottom: 10px; max-width: none; } }

/* ads */
.ad { margin: 28px 0; min-height: 0; text-align: center; }
.ad-label { display: block; font-size: .7rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }

/* reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Tool-specific helpers ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border-2); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-family: var(--font-en), var(--font-ar); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.swatch { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); cursor: pointer; background: var(--surface); transition: .15s; }
.swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.swatch i { display: block; height: 70px; }
.swatch span { display: block; padding: 7px; font-family: var(--mono); font-size: .8rem; text-align: center; }
.timer-display { font-family: var(--font-en); font-variant-numeric: tabular-nums; font-weight: 800; font-size: clamp(3rem, 13vw, 6.5rem); line-height: 1; letter-spacing: -.04em; text-align: center; direction: ltr; }
.ring-wrap { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 0 auto; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-wrap .inner { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.sig-canvas { width: 100%; height: 280px; border-radius: 16px; border: 2px dashed var(--border-2); background: #fff; touch-action: none; cursor: crosshair; display: block; }
.wheel-wrap { position: relative; width: min(420px, 86vw); aspect-ratio: 1; margin: 0 auto; }
.wheel-wrap canvas { width: 100%; height: 100%; }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid var(--text); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); z-index: 2; }
.typing-box { font-size: 1.25rem; line-height: 2; padding: 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); user-select: none; min-height: 140px; }
.typing-box .ok { color: var(--success); }
.typing-box .bad { color: var(--danger); background: var(--danger-soft); border-radius: 4px; }
.typing-box .cur { border-bottom: 3px solid var(--brand-2); }
.compass { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle, var(--surface) 55%, var(--surface-3) 56%); border: 1px solid var(--border-2); box-shadow: var(--shadow); }
.compass .needle { position: absolute; inset: 0; transition: transform .4s ease; }
.compass .needle::before { content: ""; position: absolute; left: 50%; top: 10%; width: 8px; height: 40%; transform: translateX(-50%); border-radius: 8px; background: linear-gradient(#059669, #10b981); }
.compass .needle::after { content: "🕋"; position: absolute; left: 50%; top: 2%; transform: translateX(-50%); font-size: 26px; }
.compass .dial { position: absolute; inset: 0; transition: transform .3s ease; }
.compass .dial span { position: absolute; left: 50%; top: 50%; font-weight: 800; font-size: .85rem; color: var(--muted); font-family: var(--font-en); }
.compass .hub { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transform: translate(-50%, -50%); }
.prayer-list { display: grid; gap: 10px; }
.prayer { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.prayer b { margin-inline-start: auto; font-family: var(--font-en); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.prayer.next { background: linear-gradient(135deg, rgba(5, 150, 105, .14), rgba(202, 138, 4, .14)); border-color: rgba(5, 150, 105, .4); }
.prayer .tile { width: 40px; height: 40px; border-radius: 12px; }
.prayer .tile .ico { width: 22px; height: 22px; }
.qr-out { display: grid; place-items: center; padding: 20px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border); min-height: 280px; }
.qr-out canvas, .qr-out svg { max-width: 100%; height: auto; border-radius: 10px; }
video.cam { width: 100%; max-height: 420px; border-radius: 18px; background: #000; object-fit: cover; }
.chart-box { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.preview-img { max-width: 100%; max-height: 360px; border-radius: 14px; display: block; margin: 0 auto; box-shadow: var(--shadow-sm); background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 50%/20px 20px; }
.gradient-preview { height: 220px; border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.highlight mark { background: rgba(250, 204, 21, .45); color: inherit; border-radius: 3px; padding: 0 1px; }
.wordcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.wordcloud span { padding: 4px 10px; border-radius: 99px; background: var(--surface-3); font-size: .86rem; font-weight: 600; }
.calendar-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dice-face { font-size: 4.5rem; line-height: 1; }
.coin { width: 160px; height: 160px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: #78350f; background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b 60%, #b45309); box-shadow: inset 0 -8px 16px rgba(0, 0, 0, .2), var(--shadow); transition: transform .9s cubic-bezier(.3, 1.4, .5, 1); }
.rec-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.level { height: 12px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.level i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444); transition: width .08s; }
.strength { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.strength i { display: block; height: 100%; transition: width .3s, background .3s; }
.pw-out { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; padding: 18px 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); word-break: break-all; direction: ltr; text-align: left; min-height: 66px; }
.gauge { position: relative; height: 16px; border-radius: 99px; background: linear-gradient(90deg, #60a5fa 0 14%, #34d399 14% 40%, #fbbf24 40% 60%, #f87171 60% 100%); margin: 26px 0 8px; }
.gauge i { position: absolute; top: -8px; width: 4px; height: 32px; border-radius: 4px; background: var(--text); transform: translateX(-50%); transition: left .5s cubic-bezier(.2, .8, .2, 1); }
html[dir="rtl"] .gauge { direction: ltr; }
.gauge-labels { position: relative; height: 18px; font-size: .75rem; color: var(--muted); direction: ltr; }
.gauge-labels span { position: absolute; transform: translateX(-50%); }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .stats, .stats.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-inline-end-color: transparent; display: inline-block; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.drag-handle { cursor: grab; color: var(--muted); }
.file-item.dragging { opacity: .5; }
.file-item .btn-icon { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 10px; }
.file-item .btn-icon .ico { width: 17px; height: 17px; }
.thumb .rot { position: absolute; bottom: 30px; inset-inline-start: 10px; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; box-shadow: var(--shadow-sm); }
.thumb canvas { transition: transform .25s; }
