/* APPLIX by URIX — Dark Premium
   Palette: black page, charcoal surfaces, electric violet + blue.
   Type: Rubik (display, numbers) + IBM Plex Sans Hebrew (UI, body).
   Logical properties everywhere so RTL (he) and LTR (en) share one stylesheet. */

:root {
  --brand-1: #8B5CF6;
  --brand-2: #3B82F6;
  --bg: #000000;
  --surface-1: #101016;
  --surface-2: #17171F;
  --surface-3: #20202B;
  --line: #24242F;
  --line-strong: #353544;
  --text: #F3F3F8;
  --text-2: #B6B6C8;
  --text-3: #7E7E93;
  --ok: #34D399;
  --warn: #FBBF24;
  --bad: #F87171;
  --grad: linear-gradient(120deg, var(--brand-1), var(--brand-2));
  --brand-soft: color-mix(in oklab, var(--brand-1) 16%, transparent);
  --blue-soft: color-mix(in oklab, var(--brand-2) 16%, transparent);
  --r-xl: 28px;
  --r-l: 20px;
  --r-m: 14px;
  --r-s: 10px;
  --font-ui: 'IBM Plex Sans Hebrew', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Rubik', 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  --max: 1240px;
  --pad: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --bottom-h: 0px;
  --focus: 0 0 0 3px color-mix(in oklab, var(--brand-1) 55%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--bottom-h);
}
body.modal-open { overflow: hidden; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
::selection { background: color-mix(in oklab, var(--brand-1) 45%, transparent); }
[hidden] { display: none !important; }
.ic { flex: none; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 13px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--surface-2); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
main { flex: 1; outline: none; }
.noscript { max-width: 760px; margin: 40px auto; padding: 0 20px; }

/* ---------- announcement ---------- */
.announce { font-size: 14px; text-align: center; padding: 9px var(--pad); background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--text-2); }
.announce.tone-success { background: color-mix(in oklab, var(--ok) 14%, var(--bg)); color: #c9f5e4; }
.announce.tone-warning { background: color-mix(in oklab, var(--warn) 14%, var(--bg)); color: #fbe7b0; }
.announce.tone-info { background: color-mix(in oklab, var(--brand-1) 16%, var(--bg)); color: #e1d7ff; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: 0.06em; direction: ltr; }
.brand-by { font-size: 9.5px; letter-spacing: 0.32em; color: var(--text-3); margin-top: 4px; direction: ltr; font-weight: 600; }
.brand-logo-img { height: 36px; width: auto; max-width: 160px; object-fit: contain; }
.header-search { flex: 1; max-width: 560px; margin-inline: auto; position: relative; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.nav-links { display: flex; gap: 4px; }
.nav-link { padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 15px; }
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-2); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--text-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.lang-btn { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; color: var(--text-2); }
.lang-btn:hover { color: var(--text); border-color: var(--text-3); }
.user-btn { display: inline-flex; align-items: center; gap: 8px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong); }
.user-btn .avatar { width: 32px; height: 32px; }
.menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: var(--r-m); padding: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.6); z-index: 50; }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head strong { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-size: 15px; text-align: start; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }
.user-menu-wrap { position: relative; }

/* search box + suggestions */
.search-box { display: flex; align-items: center; gap: 10px; height: 46px; padding-inline: 16px 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; transition: border-color .15s, background .15s; }
.search-box:focus-within { border-color: color-mix(in oklab, var(--brand-1) 60%, var(--line)); background: var(--surface-1); box-shadow: var(--focus); }
.search-box .ic { color: var(--text-3); }
.search-box input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; font-size: 15px; height: 100%; }
.search-box input::placeholder { color: var(--text-3); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; color: var(--text-3); }
.search-clear:hover { background: var(--surface-3); color: var(--text); }
.suggest { position: absolute; inset-inline: 0; top: calc(100% + 8px); background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: var(--r-m); padding: 8px; z-index: 60; box-shadow: 0 30px 70px rgba(0,0,0,.65); max-height: min(70vh, 520px); overflow: auto; }
.suggest-group + .suggest-group { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.suggest-label { font-size: 12px; color: var(--text-3); padding: 6px 10px 4px; }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.suggest-item[aria-selected="true"], .suggest-item:hover { background: var(--surface-2); }
.suggest-item .app-icon { width: 36px; height: 36px; border-radius: 9px; }
.suggest-item small { display: block; color: var(--text-3); font-size: 12.5px; }
.suggest-all { color: var(--text-2); font-size: 14px; }
.suggest mark { background: none; color: var(--text); font-weight: 700; }

/* mobile search sheet */
.search-sheet { position: fixed; inset: 0; z-index: 80; background: var(--bg); padding: 12px var(--pad); display: flex; flex-direction: column; gap: 12px; }
.search-sheet-head { display: flex; gap: 8px; align-items: center; }
.search-sheet-head .search-box { flex: 1; }
.search-sheet .suggest { position: static; box-shadow: none; border: 0; padding: 0; max-height: none; background: transparent; }

/* bottom nav (mobile) */
.bottom-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 45; display: none; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11.5px; color: var(--text-3); }
.bottom-nav .active { color: var(--text); }
.bottom-nav .active .ic { color: var(--brand-1); }
.bottom-nav .avatar { width: 22px; height: 22px; font-size: 11px !important; }

@media (max-width: 860px) {
  :root { --header-h: 58px; --bottom-h: calc(62px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: flex; }
  .header-search, .nav-links, .hide-mobile { display: none !important; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name { font-size: 19px; }
}
@media (min-width: 861px) { .show-mobile { display: none !important; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .1s, opacity .15s; border: 1px solid transparent; position: relative; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-busy { color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px -10px color-mix(in oklab, var(--brand-1) 80%, transparent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-soft { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-soft:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-3); }
.btn-danger { background: color-mix(in oklab, var(--bad) 18%, transparent); color: #fecaca; border-color: color-mix(in oklab, var(--bad) 40%, transparent); }
.btn-danger:hover { background: color-mix(in oklab, var(--bad) 28%, transparent); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 17px; border-radius: 16px; }
.btn-block { width: 100%; }
.link { color: color-mix(in oklab, var(--brand-1) 60%, white); font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { background: var(--brand-soft); border-color: color-mix(in oklab, var(--brand-1) 50%, transparent); color: var(--text); }
.chip-sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); scroll-padding-inline: var(--pad); }
.chip-row::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.pill-ok { background: color-mix(in oklab, var(--ok) 16%, transparent); color: #a7f3d0; }
.pill-warn { background: color-mix(in oklab, var(--warn) 16%, transparent); color: #fde68a; }
.pill-bad { background: color-mix(in oklab, var(--bad) 16%, transparent); color: #fecaca; }
.pill-brand { background: var(--brand-soft); color: #ddd6fe; }

/* ---------- stars ---------- */
.stars { position: relative; display: inline-flex; vertical-align: middle; direction: ltr; }
[dir="rtl"] .stars { transform: scaleX(-1); }
.stars svg { fill: currentColor; flex: none; }
.stars-bg { display: inline-flex; gap: 1px; color: #3a3a4a; }
.stars-fg { position: absolute; top: 0; bottom: 0; left: 0; display: inline-flex; gap: 1px; overflow: hidden; color: #FBBF24; white-space: nowrap; }
.star-ic { color: #FBBF24; }
.rating-badge { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-family: var(--font-display); }

/* ---------- app icons ---------- */
.app-icon { border-radius: 23%; object-fit: cover; background: var(--surface-2); flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.app-icon-fallback { display: inline-grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #fff; background: linear-gradient(140deg, color-mix(in oklab, var(--brand-1) 70%, #000), color-mix(in oklab, var(--brand-2) 60%, #000)); }
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); }
.avatar-fallback { display: inline-grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(140deg, color-mix(in oklab, var(--brand-1) 55%, #222), color-mix(in oklab, var(--brand-2) 45%, #222)); }

/* ---------- hero (the one bold moment) ---------- */
.hero { position: relative; margin-top: 20px; border-radius: var(--r-xl); overflow: hidden; background: radial-gradient(120% 90% at 85% 10%, #15121f 0%, #07070b 55%, #000 100%); border: 1px solid var(--line); isolation: isolate; }
[dir="rtl"] .hero { background: radial-gradient(120% 90% at 15% 10%, #15121f 0%, #07070b 55%, #000 100%); }
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; padding: clamp(28px, 5vw, 64px); min-height: 400px; }
.hero h1 { font-size: clamp(32px, 5.2vw, 56px); font-weight: 800; letter-spacing: -0.02em; max-width: 14ch; text-wrap: balance; }
.hero p { margin-top: 16px; font-size: clamp(16px, 1.6vw, 18px); color: var(--text-2); max-width: 46ch; text-wrap: pretty; }
.hero .btn { margin-top: 28px; }
.hero-bg-img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero-bg-img + .hero-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(0,0,0,.85), rgba(0,0,0,.35)); }
[dir="rtl"] .hero-bg-img + .hero-shade { background: linear-gradient(270deg, rgba(0,0,0,.85), rgba(0,0,0,.35)); }
.beams { position: absolute; z-index: 1; inset-block: -20%; inset-inline-end: -6%; width: 62%; pointer-events: none; }
.beam { position: absolute; top: 50%; left: 50%; width: 120%; height: 74px; border-radius: 999px; transform-origin: center; filter: blur(.5px); }
.beam-b { background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--brand-2) 85%, white) 30%, var(--brand-2) 70%, transparent); transform: translate(-50%, -50%) rotate(-45deg); opacity: .8; }
.beam-v { background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--brand-1) 75%, white) 30%, var(--brand-1) 70%, transparent); transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 0 18px #07070b; }
.beam-glow { position: absolute; top: 50%; left: 50%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%); background: radial-gradient(closest-side, color-mix(in oklab, var(--brand-1) 40%, transparent), transparent); filter: blur(30px); }
.hero-has-img .beams { opacity: .35; }
.spotlight { justify-self: center; width: min(100%, 360px); background: color-mix(in oklab, var(--surface-1) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line-strong); border-radius: var(--r-l); padding: 22px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.8); }
.spotlight-label { font-size: 13px; color: var(--text-3); margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.spotlight-head { display: flex; gap: 14px; align-items: center; }
.spotlight-head .app-icon { width: 72px; height: 72px; }
.spotlight-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.spotlight p { font-size: 14.5px; margin-top: 14px; color: var(--text-2); }
.spotlight .btn { margin-top: 18px; width: 100%; }
.spotlight .card-stats { margin-top: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .hero .beam-v { animation: beam-in-v 1.1s var(--ease) both .1s; }
  .hero .beam-b { animation: beam-in-b 1.1s var(--ease) both; }
  .hero .spotlight { animation: rise .8s var(--ease) both .55s; }
}
@keyframes beam-in-v { from { transform: translate(-50%, -50%) rotate(45deg) scaleX(0); } }
@keyframes beam-in-b { from { transform: translate(-50%, -50%) rotate(-45deg) scaleX(0); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (max-width: 860px) {
  .hero { margin-top: 12px; border-radius: var(--r-l); }
  .hero-inner { grid-template-columns: 1fr; min-height: 0; gap: 24px; padding: 28px 20px; }
  .beams { width: 100%; inset-inline-end: -45%; inset-block: -10% 35%; opacity: .5; }
  .hero h1 { max-width: 16ch; }
  .spotlight { width: 100%; }
}

/* ---------- sections & rails ---------- */
.section { margin-top: clamp(32px, 5vw, 52px); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sec-head h2 { font-size: clamp(20px, 2.4vw, 25px); }
.sec-head .sub { color: var(--text-3); font-size: 14px; margin-top: 2px; }
.sec-tools { display: flex; align-items: center; gap: 6px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 116px; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--pad) * -1); padding: 2px var(--pad) 6px; scroll-padding-inline: var(--pad); }
.rail::-webkit-scrollbar { display: none; }
.rail-card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--r-m); transition: background .15s; min-width: 0; }
.rail-card:hover { background: var(--surface-1); }
.rail-card .app-icon { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 4px; }
.rail-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail-meta { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-rating { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 600; min-height: 20px; }
.soon { font-family: var(--font-ui); font-weight: 500; color: var(--text-3); font-size: 12.5px; }
.rail-arrows { display: flex; gap: 4px; }
@media (min-width: 861px) { .rail { grid-auto-columns: 150px; } }

/* ---------- cards grid & list ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { width: 36px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.app-list { display: flex; flex-direction: column; gap: 4px; }
.app-card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-l); transition: border-color .2s, background .2s; min-width: 0; }
.app-card:hover { border-color: var(--line-strong); background: color-mix(in oklab, var(--surface-1) 70%, var(--surface-2)); }
.app-card-link { display: flex; flex-direction: column; gap: 12px; padding: 18px; height: 100%; }
.app-card-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-card-titles { min-width: 0; display: flex; flex-direction: column; }
.app-card-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-card-dev { color: var(--text-3); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-card-desc { color: var(--text-2); font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 641px) { .app-card-desc { min-height: 3em; } }
.card-stats { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--text-2); }
.card-stat { display: inline-flex; align-items: center; gap: 5px; }
.app-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.app-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-m); transition: background .15s; }
.app-row:hover { background: var(--surface-1); }
.app-row-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.app-row-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.app-row-name { font-weight: 600; font-size: 16px; }
.app-row-dev { color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.app-row-desc { color: var(--text-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-row .card-stats { margin-top: 3px; font-size: 12.5px; }
.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.load-more { display: flex; justify-content: center; padding: 24px 0 8px; }
.sentinel { height: 1px; }
@media (max-width: 520px) { .app-row-btn { display: none; } }

/* ---------- categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.cat-tile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-l); background: var(--surface-1); border: 1px solid var(--line); transition: border-color .15s, background .15s; }
.cat-tile:hover { border-color: var(--line-strong); background: var(--surface-2); }
.cat-tile-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: #d8ccff; flex: none; }
.cat-tile:nth-child(even) .cat-tile-ic { background: var(--blue-soft); color: #cfe0ff; }
.cat-tile strong { display: block; font-weight: 600; }
.cat-tile small { color: var(--text-3); }
.page-head { padding-top: 28px; display: flex; align-items: center; gap: 16px; }
.page-head h1 { font-size: clamp(26px, 3.6vw, 36px); }
.page-head p { color: var(--text-2); margin-top: 4px; }

/* ---------- skeletons ---------- */
.skel { display: block; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
.skel-card { pointer-events: none; }
.app-card.skel-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 190px; }
.skel-row { display: flex; gap: 14px; align-items: center; }
.skel-col { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skel-icon { width: 60px; height: 60px; border-radius: 23%; flex: none; }
.skel-icon-lg { width: 100%; aspect-ratio: 1; border-radius: 23%; }
.skel-line { height: 13px; width: 85%; }
.skel-line.short { width: 50%; }
.skel-block { height: 220px; border-radius: var(--r-l); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---------- empty / error ---------- */
.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-l); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-mark { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); margin-bottom: 6px; }
.empty h3 { font-size: 19px; }
.empty p { color: var(--text-2); max-width: 44ch; }
.empty .btn { margin-top: 10px; }
.page-error { padding: 80px 20px; text-align: center; color: var(--text-3); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text-2); min-width: 0; }
.field > span:first-child { color: var(--text); }
.hint { color: var(--text-3); font-weight: 400; font-size: 12.5px; }
.input, .select, .textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 14px; height: 46px; font-size: 15.5px; color: var(--text); transition: border-color .15s, background .15s; }
.textarea { padding: 12px 14px; height: auto; min-height: 110px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: color-mix(in oklab, var(--brand-1) 70%, var(--line)); box-shadow: var(--focus); background: var(--surface-1); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select { appearance: none; padding-inline-end: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237E7E93' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
[dir="rtl"] .select { background-position: left 12px center; }
.select-sm { height: 38px; font-size: 14px; border-radius: 10px; width: auto; }
.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-inline-end: 46px; }
.input-addon { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; color: var(--text-3); border-radius: 9px; }
.input-addon:hover { color: var(--text); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-1); flex: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; cursor: pointer; }
.switch-text { display: flex; flex-direction: column; }
.switch-text small { color: var(--text-3); }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; flex: none; cursor: pointer; transition: background .2s; }
.switch input::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: #c8c8d6; transition: transform .2s var(--ease), background .2s; }
.switch input:checked { background: var(--brand-1); border-color: var(--brand-1); }
.switch input:checked::after { background: #fff; transform: translateX(18px); }
[dir="rtl"] .switch input:checked::after { transform: translateX(-18px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-error { background: color-mix(in oklab, var(--bad) 12%, transparent); border: 1px solid color-mix(in oklab, var(--bad) 35%, transparent); color: #fecaca; padding: 10px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.form-ok { background: color-mix(in oklab, var(--ok) 12%, transparent); border: 1px solid color-mix(in oklab, var(--ok) 35%, transparent); color: #bbf7d0; padding: 12px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type=color] { width: 46px; height: 46px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); padding: 4px; }

/* ---------- panels ---------- */
.panel { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(18px, 3vw, 26px); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 19px; margin-bottom: 14px; }
.panel h3 { font-size: 16px; margin-bottom: 10px; }
.panel-danger { border-color: color-mix(in oklab, var(--bad) 35%, var(--line)); }

/* ---------- app page ---------- */
.app-page { padding-top: 24px; }
.app-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; }
.app-top .app-icon { width: 128px; height: 128px; }
.app-title { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; }
.app-dev { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.app-dev a { color: color-mix(in oklab, var(--brand-1) 55%, white); font-weight: 600; }
.app-short { margin-top: 12px; color: var(--text-2); font-size: 17px; max-width: 60ch; }
.stat-strip { display: flex; margin-top: 22px; border-block: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.stat-strip::-webkit-scrollbar { display: none; }
.stat { flex: 1 0 auto; min-width: 104px; padding: 12px 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.stat + .stat { border-inline-start: 1px solid var(--line); }
.stat-v { font-family: var(--font-display); font-weight: 700; font-size: 18px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.stat-l { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.app-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.app-actions .btn-primary { min-width: 220px; }
.fav-btn[aria-pressed="true"] { color: #fda4af; border-color: color-mix(in oklab, #fb7185 40%, transparent); background: color-mix(in oklab, #fb7185 10%, transparent); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }
.dl-panel { margin-top: 16px; background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: var(--r-l); padding: 18px; max-width: 560px; }
.dl-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 14.5px; }
.dl-head strong { font-family: var(--font-display); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.progress > span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .2s linear; }
.progress.indeterminate > span { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
[dir="rtl"] .progress.indeterminate > span { animation-name: indet-rtl; }
@keyframes indet-rtl { 0% { transform: translateX(100%); } 100% { transform: translateX(-300%); } }
.dl-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--text-3); }
.dl-result { margin-top: 12px; display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.dl-result.ok { color: #a7f3d0; }
.dl-result.bad { color: #fecaca; }
.dl-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.app-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; margin-top: 36px; align-items: start; }
.app-layout > aside { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1020px) { .app-layout { grid-template-columns: 1fr; } .app-layout > aside { position: static; } }
@media (max-width: 640px) {
  .app-top { grid-template-columns: 1fr; gap: 16px; }
  .app-top .app-icon { width: 96px; height: 96px; }
  .app-actions .btn-primary { flex: 1; min-width: 0; }
}
.block + .block { margin-top: 36px; }
.block > h2 { font-size: 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.gallery { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 8px; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); scroll-padding-inline: var(--pad); }
.gallery-item { scroll-snap-align: start; flex: none; height: clamp(260px, 42vw, 420px); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); position: relative; }
.gallery-item img { height: 100%; width: auto; object-fit: cover; }
.gallery-item button.zoom { position: absolute; inset: 0; width: 100%; cursor: zoom-in; }
.video-item { aspect-ratio: 16 / 9; height: clamp(260px, 42vw, 420px); }
.video-item video, .video-item iframe { width: 100%; height: 100%; border: 0; background: #000; }
.video-facade { position: absolute; inset: 0; display: grid; place-items: center; background: #000 center / cover no-repeat; }
.video-facade span { width: 68px; height: 68px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(6px); }
.prose { color: var(--text-2); font-size: 16px; line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }
.prose.clamped { max-height: 11.5em; overflow: hidden; mask-image: linear-gradient(#000 70%, transparent); -webkit-mask-image: linear-gradient(#000 70%, transparent); }
.more-btn { margin-top: 10px; color: color-mix(in oklab, var(--brand-1) 55%, white); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.info-cell { background: var(--surface-1); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.info-cell dt { color: var(--text-3); font-size: 12.5px; }
.info-cell dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.perm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.perm { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--line); }
.perm-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.perm.sensitive .perm-ic { background: color-mix(in oklab, var(--warn) 14%, transparent); color: #fde68a; }
.perm-text { display: flex; flex-direction: column; min-width: 0; }
.perm-text small { color: var(--text-3); font-size: 12px; direction: ltr; text-align: start; overflow-wrap: anywhere; }
.hash { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; }
.hash code { flex: 1; min-width: 0; overflow-wrap: anywhere; direction: ltr; text-align: left; color: var(--text-2); }
.side-card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; }
.side-card h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.side-card p { color: var(--text-2); font-size: 14px; }
.dev-links { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.dev-links a, .dev-links button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); font-size: 14.5px; text-align: start; width: 100%; overflow-wrap: anywhere; }
.dev-links a:hover, .dev-links button:hover { background: var(--surface-2); color: var(--text); }
.versions { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.version { padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; background: var(--surface-1); }
.version + .version { border-top: 1px solid var(--line); }
.version-name { font-family: var(--font-display); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.version-meta { color: var(--text-3); font-size: 13px; }
.version-notes { grid-column: 1 / -1; color: var(--text-2); font-size: 14px; white-space: pre-line; }

/* reviews */
.rating-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; padding: 20px; border-radius: var(--r-l); background: var(--surface-1); border: 1px solid var(--line); }
.rating-big { text-align: center; }
.rating-big strong { font-family: var(--font-display); font-size: 56px; font-weight: 700; line-height: 1; display: block; }
.rating-big .stars { margin-top: 8px; }
.rating-big small { display: block; color: var(--text-3); margin-top: 6px; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 13px; color: var(--text-3); padding: 2px 4px; border-radius: 8px; text-align: start; }
.bar-row:hover, .bar-row[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #FBBF24; border-radius: inherit; }
.review-form { margin-top: 16px; }
.star-input { display: inline-flex; gap: 4px; direction: ltr; }
[dir="rtl"] .star-input { flex-direction: row-reverse; }
.star-input button { width: 40px; height: 40px; display: grid; place-items: center; color: #3a3a4a; border-radius: 10px; }
.star-input button svg { fill: currentColor; width: 30px; height: 30px; }
.star-input button.on { color: #FBBF24; }
.star-input button:hover { background: var(--surface-2); }
.reviews { display: flex; flex-direction: column; margin-top: 14px; }
.review { padding: 18px 0; border-bottom: 1px solid var(--line); }
.review-head { display: flex; align-items: center; gap: 12px; }
.review-who { display: flex; flex-direction: column; min-width: 0; }
.review-who strong { font-weight: 600; font-size: 15px; }
.review-who small { color: var(--text-3); font-size: 12.5px; }
.review-rating { margin-top: 10px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); }
.review-body { margin-top: 8px; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.review-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.review-actions .btn { height: 32px; font-size: 13px; padding: 0 10px; }
.review-actions .voted { color: var(--text); border-color: color-mix(in oklab, var(--brand-1) 50%, transparent); background: var(--brand-soft); }
.replies { margin-top: 12px; margin-inline-start: 18px; padding-inline-start: 16px; border-inline-start: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.reply { font-size: 14.5px; }
.reply.official { background: var(--brand-soft); border: 1px solid color-mix(in oklab, var(--brand-1) 30%, transparent); border-radius: 14px; padding: 12px 14px; }
.reply-head { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.reply-head strong { color: var(--text); font-size: 14px; }
.reply-body { color: var(--text-2); margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
.my-review { border: 1px solid color-mix(in oklab, var(--brand-1) 35%, var(--line)); border-radius: var(--r-l); padding: 16px 18px; background: color-mix(in oklab, var(--brand-1) 6%, var(--surface-1)); margin-top: 16px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--line); color: var(--text-2); font-size: 14.5px; }
.notice .ic { margin-top: 2px; color: var(--text-3); }
@media (max-width: 520px) { .rating-summary { grid-template-columns: 1fr; gap: 16px; } }

/* steps (install instructions) */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; color: var(--text-2); }
.steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: #ddd6fe; font-family: var(--font-display); font-weight: 700; }

/* ---------- auth ---------- */
.auth { min-height: calc(100vh - var(--header-h) - 120px); display: grid; place-items: center; padding: 32px var(--pad); }
.auth-card { width: min(100%, 440px); background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(24px, 5vw, 36px); }
.auth-card .brand-mark { width: 44px; height: 44px; margin-bottom: 18px; }
.auth-card h1 { font-size: 26px; }
.auth-card .sub { color: var(--text-2); margin-top: 6px; margin-bottom: 22px; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--text-2); font-size: 14.5px; }

/* ---------- account ---------- */
.account-head { display: flex; align-items: center; gap: 16px; padding-top: 28px; }
.account-head .avatar { width: 64px; height: 64px; }
.account-head h1 { font-size: 26px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 12px 14px; color: var(--text-3); font-weight: 600; font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand-1); }
.tab-panel { padding-top: 20px; }
.dl-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-m); }
.dl-item:hover { background: var(--surface-1); }
.dl-item .app-icon { width: 52px; height: 52px; }
.dl-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dl-item-text small { color: var(--text-3); }
.avatar-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-edit .avatar { width: 72px; height: 72px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: 1fr; } }

/* ---------- static pages ---------- */
.doc { max-width: 760px; margin-inline: auto; padding-top: 32px; }
.doc h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 20px; }
.doc .prose { font-size: 16.5px; }
.contact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 24px; }
.contact-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-m); background: var(--surface-1); border: 1px solid var(--line); overflow-wrap: anywhere; }

/* ---------- footer ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--surface-1) 60%, transparent)); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding-block: 44px 28px; }
.footer-grid h4 { font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-grid a { color: var(--text-2); font-size: 14.5px; }
.footer-grid a:hover { color: var(--text); }
.footer-about p { color: var(--text-3); font-size: 14px; margin-top: 14px; max-width: 34ch; }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-3); font-size: 13px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } .site-footer { margin-top: 48px; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 120; inset-inline: 0; bottom: calc(var(--bottom-h) + 16px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 12px 16px; border-radius: 14px; background: #1d1d27; border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgba(0,0,0,.6); font-size: 14.5px; opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .25s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast-success .ic { color: var(--ok); }
.toast-error .ic { color: var(--bad); }
.toast-info .ic { color: color-mix(in oklab, var(--brand-1) 60%, white); }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-wrap.in { opacity: 1; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.modal { position: relative; width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: var(--r-l); box-shadow: 0 40px 100px rgba(0,0,0,.7); transform: translateY(8px) scale(.98); transition: transform .22s var(--ease); }
.modal-wrap.in .modal { transform: none; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px 20px; }
[dir="rtl"] .modal-head { padding: 16px 20px 6px 18px; }
.modal-title { font-size: 19px; }
.modal-body { padding: 10px 20px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-wrap { place-items: end center; padding: 0; }
  .modal:not(.modal-full) { border-radius: var(--r-l) var(--r-l) 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
.modal-full { max-width: none; height: 100%; max-height: none; border-radius: 0; background: #000; border: 0; }
.modal-wrap:has(.modal-full) { padding: 0; }
.modal-lightbox .modal-head { position: absolute; inset-inline: 0; top: 0; z-index: 3; }
.modal-lightbox .modal-body { padding: 0; height: 100%; overflow: hidden; }
.lightbox { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.lb-stage { width: 100%; height: 100%; display: grid; place-items: center; overflow: auto; }
.lb-img { max-width: 100%; max-height: 100vh; object-fit: contain; cursor: zoom-in; transition: transform .25s var(--ease); touch-action: pinch-zoom; }
.lb-img.zoomed { transform: scale(2); cursor: zoom-out; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; background: rgba(20,20,28,.7); color: #fff; border-radius: 50%; }
.lb-prev { inset-inline-start: 12px; }
.lb-next { inset-inline-end: 12px; }
.lb-count { position: absolute; bottom: 16px; inset-inline: 0; text-align: center; color: var(--text-2); font-size: 14px; }

/* ---------- misc ---------- */
.badge-dot { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line); margin-block: 20px; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ---------- URIX ADMIN ---------- */
.admin { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; padding-top: 24px; align-items: start; }
.admin-nav { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: var(--r-l); background: var(--surface-1); border: 1px solid var(--line); }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; font-size: 15px; }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active { background: var(--brand-soft); color: var(--text); }
.admin-nav a.active .ic { color: color-mix(in oklab, var(--brand-1) 60%, white); }
.admin-nav .badge-dot { margin-inline-start: auto; }
.admin-back { margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px !important; padding-top: 14px !important; }
.admin-main { min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head h1 { font-size: clamp(22px, 3vw, 28px); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.admin-grid > .panel + .panel { margin-top: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--r-m); background: var(--surface-1); border: 1px solid var(--line); min-width: 0; }
a.kpi:hover { border-color: var(--line-strong); }
.kpi-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: #ddd6fe; margin-bottom: 8px; }
.kpi:nth-child(even) .kpi-ic { background: var(--blue-soft); color: #cfe0ff; }
.kpi-v { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.15; }
.kpi-l { color: var(--text-2); font-size: 13.5px; }
.kpi-s { color: var(--text-3); font-size: 12.5px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font-ui); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: color-mix(in oklab, var(--brand-1) 50%, transparent); }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li { padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.admin-list li:last-child { border-bottom: 0; }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; background: var(--surface-1); }
.admin-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-width: 0; }
.admin-row + .admin-row { border-top: 1px solid var(--line); }
a.admin-row:hover { background: var(--surface-2); }
.admin-row .app-icon { width: 48px; height: 48px; }
.admin-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-row-main > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row-cells { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.audit-row code { min-width: 150px; color: var(--text-2); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.sticky-save { position: sticky; bottom: calc(var(--bottom-h) + 12px); z-index: 5; display: flex; justify-content: flex-end; pointer-events: none; }
.sticky-save .btn { pointer-events: auto; box-shadow: 0 12px 30px rgba(0,0,0,.6); }
.img-field { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.img-preview { width: 96px; height: 96px; border-radius: 22px; background: var(--surface-2); border: 1px dashed var(--line-strong); display: grid; place-items: center; overflow: hidden; color: var(--text-3); flex: none; }
.img-preview.wide { width: 220px; height: 108px; border-radius: 14px; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-field-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.shot { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.shot img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.shot figcaption { padding: 4px; gap: 2px; flex-wrap: nowrap; }
.shot .icon-btn { width: 32px; height: 32px; }
.shot .icon-btn:disabled { opacity: .3; }
.version-card .kv dd.mono { font-size: 11.5px; }
.checks { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.chk small { color: var(--text-3); font-size: 12px; overflow-wrap: anywhere; }
.chk-ok .ic { color: var(--ok); }
.chk-warn .ic { color: var(--warn); }
.chk-block .ic { color: var(--bad); }
details summary { cursor: pointer; color: var(--text-2); font-size: 14px; }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { display: grid; place-items: center; height: 44px; border-radius: 12px; border: 1px solid var(--line); color: var(--text-2); }
.icon-pick input:checked + span { border-color: var(--brand-1); background: var(--brand-soft); color: var(--text); }
.icon-pick input:focus-visible + span { box-shadow: var(--focus); }
.quote { border-inline-start: 3px solid var(--line-strong); padding-inline-start: 14px; }
.review-admin .replies { margin-inline-start: 0; }
.upload-zone { border-style: dashed; border-color: var(--line-strong); }
@media (max-width: 1020px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .admin-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; padding-top: 12px; gap: 16px; }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 6px; margin-inline: calc(var(--pad) * -1); border-radius: 0; border-inline: 0; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav a { flex: none; white-space: nowrap; padding: 8px 12px; font-size: 14px; }
  .admin-back { margin-top: 0; border-top: 0; padding-top: 8px !important; border-radius: 12px !important; }
  .admin-row { flex-wrap: wrap; }
  .admin-row-cells { width: 100%; justify-content: flex-start; }
  .kpi-v { font-size: 22px; }
}
@media (min-width: 1021px) { .app-layout .gallery { margin-inline: 0; padding-inline: 0; } }
.app-layout > div { min-width: 0; }
[dir="rtl"] .kv dd.ltr, [dir="rtl"] .kv dd.mono { text-align: right; }
.settings-grid > *, .admin-grid > *, .form-grid > * { min-width: 0; }
main { overflow-x: clip; }
.admin-row-cells > span, .dim.small, .muted.small { display: inline-flex; align-items: center; gap: 4px; }
.session-ua { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-box input:focus-visible { box-shadow: none; }
