/* ============================================================================
   MR_TECHNO — Main stylesheet
   Dark technology theme · Neon blue · Android green accents · RTL
   ========================================================================== */

:root {
  --bg: #050a16;
  --bg-2: #071022;
  --bg-3: #0a1530;
  --surface: rgba(16, 28, 54, 0.62);
  --surface-solid: #0d1830;
  --surface-2: rgba(23, 39, 72, 0.55);
  --line: rgba(96, 165, 250, 0.14);
  --line-strong: rgba(96, 165, 250, 0.3);
  --text: #eaf1ff;
  --muted: #93a6c9;
  --muted-2: #6e81a5;
  --blue: #38bdf8;
  --blue-2: #22d3ee;
  --blue-deep: #0ea5e9;
  --green: #34d399;
  --green-2: #3ddc84;
  --orange: #fb923c;
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.1);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --warning: #fbbf24;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --shadow-blue: 0 18px 50px -18px rgba(56, 189, 248, 0.45);
  --font: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --header-h: 74px;
  --container: 1220px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.75;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 55% 40% at 85% -5%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(ellipse 45% 35% at 5% 15%, rgba(34, 211, 238, 0.09), transparent 60%),
    radial-gradient(ellipse 50% 45% at 50% 110%, rgba(52, 211, 153, 0.07), transparent 65%),
    linear-gradient(180deg, #060c1a 0%, #050a16 45%, #060d1c 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 197, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 197, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 80%);
}

::selection { background: rgba(56, 189, 248, 0.35); color: #fff; }

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #060c18; }
::-webkit-scrollbar-thumb { background: #1b2c4e; border-radius: 99px; border: 2px solid #060c18; }
::-webkit-scrollbar-thumb:hover { background: #27406e; }

/* ------------------------------ Layout ---------------------------------- */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: 64px; }
.section-sm { padding-block: 40px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { display: grid; place-items: center; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 28px; flex-wrap: wrap;
}
.section-head .eyebrow { margin-bottom: 8px; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; line-height: 1.3; }
.section-head p { color: var(--muted); margin-top: 8px; max-width: 54ch; font-size: 14.5px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--blue);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  padding: 5px 13px; border-radius: 99px;
  width: fit-content;
}
.eyebrow.green { color: var(--green); background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.24); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }

.gradient-text {
  background: linear-gradient(100deg, #7dd3fc 0%, #38bdf8 35%, #a5f3fc 70%, #86efac 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ------------------------------ Buttons --------------------------------- */

.btn {
  --btn-bg: linear-gradient(135deg, #38bdf8, #0ea5e9);
  --btn-fg: #041420;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: 14.5px; line-height: 1;
  padding: 12px 22px; border-radius: 12px;
  transition: transform 0.18s var(--ease), box-shadow 0.22s var(--ease),
              background 0.2s, border-color 0.2s, opacity 0.2s;
  white-space: nowrap; text-align: center; position: relative; overflow: hidden;
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-blue); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: rgba(15, 28, 54, 0.5); color: var(--text);
  border-color: var(--line-strong);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: rgba(56, 189, 248, 0.55); background: rgba(24, 43, 79, 0.65); box-shadow: none; }

.btn-soft {
  background: rgba(56, 189, 248, 0.1); color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.25);
}
.btn-soft:hover { background: rgba(56, 189, 248, 0.18); box-shadow: none; }

.btn-green {
  --btn-bg: linear-gradient(135deg, #34d399, #10b981);
  --btn-fg: #03150e;
}
.btn-green:hover { box-shadow: 0 18px 50px -18px rgba(52, 211, 153, 0.5); }

.btn-danger {
  background: var(--danger-bg); color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); box-shadow: 0 14px 34px -18px rgba(248, 113, 113, 0.6); }

.btn-sm { padding: 9px 15px; font-size: 13px; border-radius: 10px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 15px 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; width: 40px; height: 40px; border-radius: 11px; }
.btn-icon svg { width: 18px; height: 18px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--blue); font-weight: 700; font-size: 14px;
  transition: gap 0.2s var(--ease), color 0.2s;
}
.link-arrow:hover { gap: 12px; color: #7dd3fc; }
.link-arrow svg { width: 17px; height: 17px; }

/* ------------------------------ Badges ---------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; line-height: 1;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge-blue { color: #7dd3fc; background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.24); }
.badge-green { color: #6ee7b7; background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.24); }
.badge-orange { color: #fdba74; background: rgba(251, 146, 60, 0.1); border-color: rgba(251, 146, 60, 0.24); }
.badge-red { color: #fca5a5; background: var(--danger-bg); border-color: rgba(248, 113, 113, 0.28); }
.badge-muted { color: var(--muted); background: rgba(148, 163, 184, 0.08); border-color: rgba(148, 163, 184, 0.16); }
.badge-yellow { color: #fcd34d; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.24); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(13, 24, 48, 0.6);
  color: var(--muted); font-size: 12.5px; font-weight: 600;
}

/* ------------------------------ Header ---------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.site-header.scrolled {
  background: rgba(5, 10, 22, 0.82);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-color: var(--line);
  box-shadow: 0 12px 40px -20px rgba(0, 0, 0, 0.8);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-mark {
  width: 40px; height: 40px; flex: 0 0 auto;
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.45));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: 0.6px; }
.brand-name span { color: var(--blue); }
.brand-sub { font-size: 9.5px; color: var(--muted-2); letter-spacing: 2.4px; font-weight: 600; margin-top: 3px; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  position: relative; padding: 9px 14px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: #b9c7e2;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.main-nav a:hover { color: #fff; background: rgba(56, 189, 248, 0.07); }
.main-nav a.active { color: var(--blue); }
.main-nav a.active::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: 2px; height: 2px;
  border-radius: 2px; background: linear-gradient(90deg, transparent, var(--blue), transparent);
}
.main-nav a .nav-badge {
  font-size: 9px; background: rgba(52, 211, 153, 0.14); color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.3); border-radius: 5px; padding: 1px 5px;
  margin-inline-start: 5px; vertical-align: 2px;
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

.search-box { position: relative; width: 220px; }
.search-box .search-icon {
  position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted-2); pointer-events: none;
}
.search-box input {
  width: 100%; height: 40px;
  background: rgba(13, 24, 48, 0.65);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 38px 0 14px;
  font-size: 13px; color: var(--text);
  transition: border-color 0.2s, background 0.2s, width 0.25s;
}
.search-box input::placeholder { color: var(--muted-2); }
.search-box input:focus { outline: none; border-color: rgba(56, 189, 248, 0.6); background: rgba(16, 32, 60, 0.9); }

.search-pop {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
  width: min(390px, 92vw);
  background: rgba(9, 17, 34, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: 15px; box-shadow: var(--shadow);
  overflow: hidden; z-index: 260;
  animation: popIn 0.18s var(--ease);
}
.search-pop-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.search-result { display: flex; align-items: center; gap: 11px; padding: 9px; border-radius: 10px; transition: background 0.15s; }
.search-result:hover { background: rgba(56, 189, 248, 0.08); }
.search-result img, .search-result .thumb-fallback {
  width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex: 0 0 auto;
}
.search-result .sr-title { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.search-result .sr-meta { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.search-pop-foot {
  border-top: 1px solid var(--line); padding: 9px 12px;
  font-size: 12px; color: var(--muted-2); display: flex; justify-content: space-between; gap: 10px;
}
.search-pop-foot button { background: none; border: 0; color: var(--blue); font-size: 12px; font-weight: 700; }
.search-empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 13px; }

.header-admin {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: rgba(13, 24, 48, 0.55);
  font-size: 13px; font-weight: 700; color: #c5d3ee;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.header-admin:hover { border-color: rgba(56, 189, 248, 0.5); color: var(--blue); background: rgba(56, 189, 248, 0.08); }
.header-admin svg { width: 16px; height: 16px; }

.menu-toggle {
  display: none; width: 42px; height: 42px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: rgba(13, 24, 48, 0.6);
  align-items: center; justify-content: center;
}
.menu-toggle svg { width: 21px; height: 21px; }

.mobile-nav {
  display: none;
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: 199;
  padding: 16px 20px 22px;
  background: rgba(5, 10, 22, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px #000;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.mobile-nav.open { display: block; animation: slideDown 0.22s var(--ease); }
.mobile-nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 10px; border-radius: 10px; font-weight: 600; color: #c7d5ee;
  border-bottom: 1px solid rgba(148, 197, 255, 0.06);
}
.mobile-nav a.active { color: var(--blue); background: rgba(56, 189, 248, 0.07); }
.mobile-nav .search-box { width: 100%; margin-top: 12px; }

/* ------------------------------ Hero ------------------------------------ */

.hero { position: relative; padding: 54px 0 34px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; z-index: -1;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.17), transparent 66%);
  top: -220px; inset-inline-start: -160px; filter: blur(10px);
}
.hero-grid {
  display: grid; grid-template-columns: 1.06fr 0.94fr;
  gap: 44px; align-items: center;
}
.hero-content { max-width: 620px; }
.hero h1 {
  font-size: clamp(32px, 4.6vw, 54px);
  font-weight: 800; line-height: 1.22; letter-spacing: -0.5px;
  margin: 18px 0 16px;
}
.hero-sub {
  color: var(--muted); font-size: clamp(14.5px, 1.5vw, 17px);
  max-width: 46ch; line-height: 1.85;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-points { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 26px; }
.hero-point { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.hero-point svg { width: 16px; height: 16px; color: var(--green); }

.hero-visual { position: relative; display: grid; place-items: center; }
.hero-visual .hero-art { width: 100%; max-width: 560px; height: auto; filter: drop-shadow(0 34px 60px rgba(0, 0, 0, 0.55)); }
.hero-float {
  position: absolute; display: flex; align-items: center; gap: 9px;
  background: rgba(10, 20, 40, 0.82); backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); border-radius: 13px;
  padding: 9px 14px; box-shadow: var(--shadow); font-size: 12px; font-weight: 700;
  animation: floatY 5s ease-in-out infinite;
}
.hero-float .ico-bubble { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.hero-float .ico-bubble svg { width: 17px; height: 17px; }
.hero-float small { display: block; font-size: 10px; color: var(--muted-2); font-weight: 500; }
.hero-float.f1 { top: 8%; inset-inline-start: -2%; animation-delay: 0.3s; }
.hero-float.f2 { bottom: 12%; inset-inline-end: -1%; animation-delay: 1.2s; }
.hero-float.f3 { bottom: 4%; inset-inline-start: 8%; animation-delay: 2s; }

/* ------------------------------ Stats ----------------------------------- */

.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; margin-top: 46px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.9);
}
.stat-cell {
  background: linear-gradient(180deg, rgba(15, 28, 54, 0.72), rgba(9, 17, 34, 0.72));
  padding: 22px 20px; display: flex; align-items: center; gap: 14px;
  transition: background 0.25s;
}
.stat-cell:hover { background: rgba(20, 37, 68, 0.8); }
.stat-ico {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: rgba(56, 189, 248, 0.1); color: var(--blue);
  border: 1px solid rgba(56, 189, 248, 0.2);
}
.stat-ico.green { background: rgba(52, 211, 153, 0.1); color: var(--green); border-color: rgba(52, 211, 153, 0.2); }
.stat-ico.orange { background: rgba(251, 146, 60, 0.1); color: var(--orange); border-color: rgba(251, 146, 60, 0.2); }
.stat-ico.purple { background: rgba(167, 139, 250, 0.1); color: #a78bfa; border-color: rgba(167, 139, 250, 0.2); }
.stat-ico svg { width: 21px; height: 21px; }
.stat-value { font-size: 23px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

/* ------------------------------ Categories ------------------------------ */

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cat-card {
  position: relative; overflow: hidden;
  padding: 28px; border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(17, 31, 60, 0.85), rgba(8, 16, 33, 0.9));
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.cat-card::before {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  top: -110px; inset-inline-start: -70px;
  background: radial-gradient(circle, var(--cat-glow), transparent 65%);
  opacity: 0.7; transition: opacity 0.3s, transform 0.4s;
}
.cat-card:hover { transform: translateY(-5px); border-color: var(--cat-border); box-shadow: 0 34px 70px -34px var(--cat-shadow); }
.cat-card:hover::before { opacity: 1; transform: scale(1.1); }
.cat-card.windows { --cat-color: var(--blue); --cat-glow: rgba(56, 189, 248, 0.2); --cat-border: rgba(56, 189, 248, 0.42); --cat-shadow: rgba(56, 189, 248, 0.4); }
.cat-card.android { --cat-color: var(--green); --cat-glow: rgba(52, 211, 153, 0.18); --cat-border: rgba(52, 211, 153, 0.42); --cat-shadow: rgba(52, 211, 153, 0.35); }
.cat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; position: relative; }
.cat-icon {
  width: 60px; height: 60px; border-radius: 17px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--cat-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color) 30%, transparent);
  color: var(--cat-color);
  transition: transform 0.3s var(--ease);
}
.cat-icon svg { width: 30px; height: 30px; }
.cat-card:hover .cat-icon { transform: scale(1.06) rotate(-3deg); }
.cat-count { text-align: end; }
.cat-count b { display: block; font-size: 30px; font-weight: 800; color: var(--cat-color); line-height: 1; }
.cat-count span { font-size: 11.5px; color: var(--muted-2); }
.cat-card h3 { font-size: 22px; font-weight: 800; margin-top: 20px; position: relative; }
.cat-card p { color: var(--muted); font-size: 13.5px; margin-top: 7px; min-height: 46px; position: relative; }
.cat-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; position: relative; gap: 12px; }
.cat-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-tag { font-size: 10.5px; color: var(--muted-2); background: rgba(148, 163, 184, 0.07); border: 1px solid rgba(148, 163, 184, 0.12); padding: 3px 8px; border-radius: 6px; }
.cat-link {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700;
  color: var(--cat-color);
}
.cat-link svg { width: 16px; height: 16px; transition: transform 0.2s; }
.cat-card:hover .cat-link svg { transform: translateX(-4px); }

/* ------------------------------ App cards ------------------------------- */

.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.app-card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(165deg, rgba(16, 30, 57, 0.8), rgba(8, 16, 33, 0.88));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.28s var(--ease), border-color 0.28s, box-shadow 0.28s;
}
.app-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.34);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(56, 189, 248, 0.06);
}
.app-card.android:hover { border-color: rgba(52, 211, 153, 0.34); }
.app-thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(145deg, #0c1a35, #071022);
  display: block;
}
.thumb-media { position: relative; width: 100%; height: 100%; overflow: hidden; }
.thumb-media img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s var(--ease); }
.thumb-media .thumb-fallback { position: absolute; inset: 0; }
.app-card:hover .thumb-media img { transform: scale(1.05); }
.sr-thumb { position: relative; width: 38px; height: 38px; border-radius: 9px; overflow: hidden; flex: 0 0 auto; }
.sr-thumb img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.sr-thumb .thumb-fallback { position: absolute; inset: 0; font-size: 15px; border-radius: 0; }
.thumb-fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    radial-gradient(circle at 70% 20%, rgba(56, 189, 248, 0.22), transparent 55%),
    linear-gradient(145deg, #0d1c3a, #071022);
  color: rgba(125, 211, 252, 0.75);
  font-size: 34px; font-weight: 800; letter-spacing: -1px;
}
.app-card.android .thumb-fallback {
  background:
    radial-gradient(circle at 70% 20%, rgba(52, 211, 153, 0.2), transparent 55%),
    linear-gradient(145deg, #0a231d, #071022);
  color: rgba(110, 231, 183, 0.78);
}
.thumb-badges {
  position: absolute; top: 10px; inset-inline-start: 10px;
  display: flex; gap: 6px; flex-wrap: wrap; z-index: 1;
}
.thumb-badges .badge { backdrop-filter: blur(8px); background-color: rgba(7, 14, 28, 0.75); }
.thumb-time {
  position: absolute; bottom: 10px; inset-inline-end: 10px;
  font-size: 10px; color: #c7d5ee; background: rgba(5, 10, 22, 0.72);
  border: 1px solid rgba(148, 197, 255, 0.14); backdrop-filter: blur(8px);
  padding: 3px 8px; border-radius: 6px;
}
.app-body { padding: 16px; display: flex; flex-direction: column; flex: 1; gap: 9px; }
.app-title { font-size: 15.5px; font-weight: 800; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.2s; }
.app-card:hover .app-title { color: var(--blue); }
.app-card.android:hover .app-title { color: var(--green); }
.app-desc { color: var(--muted); font-size: 12.5px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 41px; }
.app-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted-2); font-size: 11px; }
.app-meta span { display: inline-flex; align-items: center; gap: 4px; }
.app-meta svg { width: 12px; height: 12px; }
.app-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(148, 197, 255, 0.07); }
.app-foot .btn { flex: 1; padding: 9px 12px; font-size: 12.5px; border-radius: 9px; }
.app-foot .btn-icon { flex: 0 0 auto; }

/* Featured card variant */
.app-card.featured::after {
  content: ""; position: absolute; top: 0; inset-inline: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}

/* ------------------------------ Page head ------------------------------- */

.page-head {
  position: relative; padding: 44px 0 30px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.page-head::before {
  content: ""; position: absolute; z-index: -1; width: 520px; height: 520px;
  border-radius: 50%; top: -320px; inset-inline-end: 8%;
  background: radial-gradient(circle, var(--head-glow, rgba(56, 189, 248, 0.14)), transparent 65%);
}
.page-head.windows { --head-glow: rgba(56, 189, 248, 0.15); }
.page-head.android { --head-glow: rgba(52, 211, 153, 0.13); }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-2); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb svg { width: 13px; height: 13px; transform: rotate(180deg); opacity: 0.6; }
.breadcrumb .current { color: var(--text); }
.page-head h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; line-height: 1.3; }
.page-head .lead { color: var(--muted); font-size: 14.5px; margin-top: 9px; max-width: 62ch; }
.page-head .head-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* ------------------------------ Catalog toolbar ------------------------- */

.catalog-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px; border: 1px solid var(--line);
  background: rgba(10, 20, 39, 0.62); backdrop-filter: blur(10px);
  border-radius: var(--radius); margin-bottom: 24px;
}
.toolbar-search { position: relative; flex: 1; min-width: 220px; }
.toolbar-search svg { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); }
.toolbar-search input {
  width: 100%; height: 42px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0 40px 0 14px; font-size: 13.5px; transition: border-color 0.2s;
}
.toolbar-search input:focus { outline: none; border-color: rgba(56, 189, 248, 0.55); }
.select-wrap { position: relative; }
.select-wrap select {
  height: 42px; appearance: none; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 38px 0 14px;
  font-size: 13px; color: #c6d4ee; min-width: 140px;
  transition: border-color 0.2s;
}
.select-wrap select:focus { outline: none; border-color: rgba(56, 189, 248, 0.55); }
.select-wrap > svg { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; }
.filter-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; }
.filter-tabs a, .filter-tabs button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 700; padding: 8px 14px; border-radius: 8px;
  transition: background 0.2s, color 0.2s; white-space: nowrap;
}
.filter-tabs a:hover, .filter-tabs button:hover { color: #fff; }
.filter-tabs a.active, .filter-tabs button.active { background: rgba(56, 189, 248, 0.14); color: var(--blue); }
.filter-tabs.green a.active, .filter-tabs.green button.active { background: rgba(52, 211, 153, 0.14); color: var(--green); }

.results-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; font-size: 12.5px; color: var(--muted-2); flex-wrap: wrap; }
.results-line b { color: var(--text); }

/* ------------------------------ Empty / skeleton ------------------------ */

.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 64px 24px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: rgba(10, 20, 39, 0.4);
}
.empty-state .empty-ico {
  width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 18px;
  display: grid; place-items: center; color: var(--blue);
  background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.18);
}
.empty-state .empty-ico svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 13.5px; max-width: 42ch; margin: 0 auto; }

.skeleton {
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(20, 35, 64, 0.5) 30%, rgba(30, 50, 88, 0.55) 50%, rgba(20, 35, 64, 0.5) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
}
.sk-card { height: 330px; }
.sk-line { height: 14px; border-radius: 6px; }

/* ------------------------------ Pagination ------------------------------ */

.pagination { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 32px; flex-wrap: wrap; }
.page-btn {
  min-width: 38px; height: 38px; padding: 0 11px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(13, 24, 48, 0.6);
  color: var(--muted); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.page-btn:hover:not(:disabled) { border-color: var(--line-strong); color: #fff; background: rgba(22, 39, 72, 0.8); }
.page-btn.active { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.4); color: var(--blue); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-btn svg { width: 16px; height: 16px; }

/* ------------------------------ Program page ---------------------------- */

.program-layout { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.program-main {
  background: linear-gradient(165deg, rgba(16, 30, 57, 0.72), rgba(8, 16, 33, 0.85));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
}
.program-cover { position: relative; aspect-ratio: 16 / 8.4; background: #081226; overflow: hidden; }
.program-cover img { width: 100%; height: 100%; object-fit: cover; }
.program-cover .thumb-fallback { font-size: 62px; }
.program-cover-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(6, 12, 24, 0.9)); }
.program-cover .cover-badges { position: absolute; top: 16px; inset-inline-start: 16px; display: flex; gap: 8px; }
.program-cover .cover-badges .badge { background-color: rgba(5, 10, 22, 0.8); backdrop-filter: blur(8px); }
.program-body { padding: 26px; }
.program-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.program-body h1 { font-size: clamp(23px, 3vw, 32px); font-weight: 800; line-height: 1.35; }
.program-sub { color: var(--muted); font-size: 14px; margin-top: 8px; }
.program-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.program-desc { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.program-desc h2 { font-size: 17px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.program-desc h2 svg { width: 18px; height: 18px; color: var(--blue); }
.program-desc .prose { color: #c0cee8; font-size: 14.5px; line-height: 2; white-space: pre-wrap; word-break: break-word; }

.program-side { position: sticky; top: calc(var(--header-h) + 18px); display: flex; flex-direction: column; gap: 16px; }
.side-card {
  background: linear-gradient(165deg, rgba(16, 30, 57, 0.75), rgba(8, 16, 33, 0.88));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px;
}
.side-card h3 { font-size: 14px; font-weight: 800; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.side-card h3 svg { width: 16px; height: 16px; color: var(--blue); }
.info-list { display: flex; flex-direction: column; gap: 0; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(148, 197, 255, 0.07); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--muted-2); display: inline-flex; align-items: center; gap: 7px; }
.info-row .k svg { width: 14px; height: 14px; }
.info-row .v { font-weight: 700; color: #dbe6fa; text-align: end; }
.download-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: 11px; color: var(--muted-2); line-height: 1.6; }
.download-note svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--green); margin-top: 2px; }
.side-card .btn-block + .btn-block { margin-top: 8px; }

.related-section { margin-top: 44px; }

/* ------------------------------ Contact --------------------------------- */

.contact-layout { display: grid; grid-template-columns: 1fr 380px; gap: 26px; align-items: start; }
.contact-card {
  background: linear-gradient(165deg, rgba(16, 30, 57, 0.72), rgba(8, 16, 33, 0.88));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px;
}
.contact-card h2 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.contact-card > p { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.contact-info { display: flex; flex-direction: column; gap: 14px; }
.contact-info-card {
  display: flex; align-items: flex-start; gap: 13px;
  background: rgba(13, 24, 48, 0.55); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px;
  transition: border-color 0.2s, transform 0.2s;
}
.contact-info-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.contact-info-card .ci-ico {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; color: var(--blue);
  background: rgba(56, 189, 248, 0.09); border: 1px solid rgba(56, 189, 248, 0.18);
}
.contact-info-card .ci-ico.green { color: var(--green); background: rgba(52, 211, 153, 0.09); border-color: rgba(52, 211, 153, 0.18); }
.contact-info-card .ci-ico.orange { color: var(--orange); background: rgba(251, 146, 60, 0.09); border-color: rgba(251, 146, 60, 0.18); }
.contact-info-card .ci-ico svg { width: 19px; height: 19px; }
.contact-info-card .ci-label { font-size: 11px; color: var(--muted-2); }
.contact-info-card .ci-value { font-size: 13.5px; font-weight: 700; margin-top: 2px; word-break: break-all; }
.contact-info-card .ci-value a:hover { color: var(--blue); }

/* ------------------------------ Forms ----------------------------------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 700; color: #c3d1ea; display: flex; align-items: center; gap: 6px; }
.field label .req { color: var(--danger); }
.field label .opt { color: var(--muted-2); font-weight: 500; font-size: 11px; }
.field .hint { font-size: 11px; color: var(--muted-2); }

.input, .textarea, .select {
  width: 100%; background: #071022;
  border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 14px; font-size: 13.5px; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder, .textarea::placeholder { color: #5d6f92; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
  background: #08132a;
}
.input:disabled, .textarea:disabled, .select:disabled { opacity: 0.55; cursor: not-allowed; }
.textarea { min-height: 130px; resize: vertical; line-height: 1.8; }
.textarea.sm { min-height: 90px; }
.select { appearance: none; cursor: pointer; }
.field-error { font-size: 11.5px; color: #fca5a5; display: none; align-items: center; gap: 5px; }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select { border-color: rgba(248, 113, 113, 0.6); }
.field.invalid .field-error { display: flex; }
.input-group { position: relative; }
.input-group .input { padding-inline-end: 42px; }
.input-group .group-btn {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
  color: var(--muted-2); display: grid; place-items: center;
}
.input-group .group-btn:hover { color: var(--blue); background: rgba(56, 189, 248, 0.08); }
.input-group .group-btn svg { width: 17px; height: 17px; }

.check-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #071022; cursor: pointer; }
.check-row input { width: 17px; height: 17px; accent-color: var(--blue); cursor: pointer; }
.check-row .cr-text { font-size: 13px; font-weight: 600; }
.check-row .cr-sub { font-size: 11px; color: var(--muted-2); font-weight: 400; }

.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px; border-radius: 11px; font-size: 12.5px; line-height: 1.65;
  border: 1px solid transparent;
}
.alert svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 2px; }
.alert-info { background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.22); color: #a5d8f5; }
.alert-success { background: var(--success-bg); border-color: rgba(52, 211, 153, 0.25); color: #86efac; }
.alert-error { background: var(--danger-bg); border-color: rgba(248, 113, 113, 0.25); color: #fca5a5; }
.alert-warning { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.24); color: #fcd34d; }
.alert a { text-decoration: underline; font-weight: 700; }

/* ------------------------------ Auth ------------------------------------ */

.auth-wrap { min-height: calc(100vh - var(--header-h) - 120px); display: grid; place-items: center; padding: 50px 20px; }
.auth-card {
  width: 100%; max-width: 430px; position: relative;
  background: linear-gradient(165deg, rgba(18, 33, 62, 0.85), rgba(8, 16, 33, 0.95));
  border: 1px solid var(--line-strong); border-radius: var(--radius-xl);
  padding: 34px; box-shadow: var(--shadow);
  overflow: hidden;
}
.auth-card::before {
  content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  top: -190px; inset-inline-start: 50%; transform: translateX(50%);
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 66%);
  pointer-events: none;
}
.auth-head { text-align: center; margin-bottom: 26px; position: relative; }
.auth-head .brand-mark { width: 54px; height: 54px; margin: 0 auto 14px; }
.auth-head h1 { font-size: 22px; font-weight: 800; }
.auth-head p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.auth-note { text-align: center; font-size: 12px; color: var(--muted-2); margin-top: 18px; }
.auth-note a { color: var(--blue); font-weight: 700; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 11px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------ Footer ---------------------------------- */

.site-footer {
  margin-top: 70px; border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(6, 12, 24, 0.4), rgba(5, 10, 22, 0.95));
  position: relative; overflow: hidden;
}
.site-footer::before {
  content: ""; position: absolute; width: 700px; height: 300px; border-radius: 50%;
  bottom: -240px; inset-inline-start: 50%; transform: translateX(50%);
  background: radial-gradient(circle, rgba(56, 189, 248, 0.09), transparent 65%);
  pointer-events: none;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px; padding: 54px 0 40px; position: relative;
}
.footer-brand p { color: var(--muted); font-size: 13px; margin-top: 14px; max-width: 36ch; line-height: 1.9; }
.footer-social { display: flex; gap: 9px; margin-top: 18px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(13, 24, 48, 0.6); color: var(--muted);
  transition: all 0.2s;
}
.footer-social a:hover { color: var(--blue); border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.08); transform: translateY(-2px); }
.footer-social svg { width: 17px; height: 17px; }
.footer-col h4 { font-size: 13px; font-weight: 800; margin-bottom: 16px; color: #dbe6fa; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--muted); font-size: 12.5px; transition: color 0.2s, padding 0.2s; }
.footer-col a:hover { color: var(--blue); padding-inline-start: 3px; }
.footer-contact-item { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; }
.footer-contact-item svg { width: 15px; height: 15px; color: var(--blue); flex: 0 0 auto; }
.footer-bottom {
  border-top: 1px solid var(--line); padding: 18px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  color: var(--muted-2); font-size: 12px; flex-wrap: wrap; position: relative;
}
.footer-bottom .made { display: flex; align-items: center; gap: 6px; }
.footer-bottom .made svg { width: 14px; height: 14px; color: var(--blue); }
.back-top {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(13, 24, 48, 0.6); color: var(--muted);
  transition: all 0.2s;
}
.back-top:hover { color: var(--blue); border-color: rgba(56, 189, 248, 0.4); transform: translateY(-2px); }
.back-top svg { width: 16px; height: 16px; }

/* ------------------------------ Feature cards / CTA --------------------- */

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card {
  padding: 24px; border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(16, 30, 57, 0.68), rgba(8, 16, 33, 0.82));
  border: 1px solid var(--line);
  transition: transform 0.25s var(--ease), border-color 0.25s;
  position: relative; overflow: hidden;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.feature-card .f-ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(56, 189, 248, 0.09); color: var(--blue);
  border: 1px solid rgba(56, 189, 248, 0.18); margin-bottom: 15px;
}
.feature-card .f-ico.green { background: rgba(52, 211, 153, 0.09); color: var(--green); border-color: rgba(52, 211, 153, 0.18); }
.feature-card .f-ico.purple { background: rgba(167, 139, 250, 0.09); color: #a78bfa; border-color: rgba(167, 139, 250, 0.18); }
.feature-card .f-ico svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.feature-card p { color: var(--muted); font-size: 12.5px; line-height: 1.8; }

.cta-band {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  padding: 40px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  background:
    radial-gradient(ellipse 50% 130% at 90% 50%, rgba(56, 189, 248, 0.2), transparent 60%),
    linear-gradient(135deg, rgba(16, 35, 68, 0.9), rgba(8, 18, 38, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.24);
  box-shadow: 0 30px 70px -40px rgba(56, 189, 248, 0.5);
}
.cta-band h2 { font-size: clamp(21px, 2.6vw, 29px); font-weight: 800; margin-bottom: 7px; }
.cta-band p { color: var(--muted); font-size: 13.5px; max-width: 55ch; }
.cta-band .cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 28px; }
}

/* admin shell hides public chrome */
body.admin-mode .site-header,
body.admin-mode .site-footer,
body.admin-mode .mobile-nav { display: none !important; }
body.admin-mode main#app { padding: 0; }
body.admin-mode { background: #060c19; }

/* ------------------------------ Admin ----------------------------------- */

.admin-shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.admin-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: rgba(7, 14, 29, 0.96); border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 30;
}
.admin-side-head { padding: 20px 18px; border-bottom: 1px solid var(--line); }
.admin-side-head .brand { gap: 9px; }
.admin-side-head .brand-mark { width: 36px; height: 36px; }
.admin-side-head .brand-name { font-size: 15px; }
.admin-side-head .brand-sub { font-size: 8.5px; }
.admin-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.admin-nav-label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; color: var(--muted-2); padding: 14px 12px 7px; }
.admin-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: #a9b9d6; font-size: 13px; font-weight: 600;
  transition: all 0.18s; border: 1px solid transparent;
}
.admin-nav a svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.8; }
.admin-nav a:hover { background: rgba(56, 189, 248, 0.07); color: #e3edff; }
.admin-nav a.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0.04));
  color: var(--blue); border-color: rgba(56, 189, 248, 0.16);
}
.admin-nav a.active svg { opacity: 1; }
.admin-nav .nav-count {
  margin-inline-start: auto; font-size: 10px; font-weight: 800;
  background: rgba(56, 189, 248, 0.14); color: var(--blue);
  border-radius: 6px; padding: 1px 6px; min-width: 20px; text-align: center;
}
.admin-nav .nav-count.red { background: rgba(248, 113, 113, 0.14); color: #fca5a5; }
.admin-side-foot { padding: 14px 10px; border-top: 1px solid var(--line); }
.admin-side-foot .user-mini { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(13, 24, 48, 0.6); border: 1px solid var(--line); margin-bottom: 8px; }
.admin-side-foot .avatar { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #38bdf8, #0ea5e9); color: #041420; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.admin-side-foot .user-mini .um-email { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-side-foot .user-mini .um-role { font-size: 9.5px; color: var(--green); }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 64px; display: flex; align-items: center; gap: 14px;
  padding: 0 26px; border-bottom: 1px solid var(--line);
  background: rgba(6, 12, 24, 0.72); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.admin-topbar h1 { font-size: 16px; font-weight: 800; }
.admin-topbar .crumb { font-size: 11.5px; color: var(--muted-2); }
.admin-topbar .top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 9px; }
.admin-burger { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(13, 24, 48, 0.6); align-items: center; justify-content: center; }
.admin-burger svg { width: 19px; height: 19px; }

.admin-content { padding: 26px; max-width: 1400px; width: 100%; margin-inline: auto; }
.admin-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-page-head h2 { font-size: 22px; font-weight: 800; }
.admin-page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.admin-page-head .aph-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.admin-stat {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, rgba(17, 31, 60, 0.72), rgba(8, 16, 33, 0.82));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 19px;
  transition: border-color 0.2s, transform 0.2s;
}
.admin-stat:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.admin-stat .as-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.admin-stat .as-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.admin-stat .as-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(56, 189, 248, 0.09); color: var(--blue); }
.admin-stat .as-ico.green { background: rgba(52, 211, 153, 0.09); color: var(--green); }
.admin-stat .as-ico.orange { background: rgba(251, 146, 60, 0.09); color: var(--orange); }
.admin-stat .as-ico.purple { background: rgba(167, 139, 250, 0.09); color: #a78bfa; }
.admin-stat .as-ico.red { background: rgba(248, 113, 113, 0.1); color: #fca5a5; }
.admin-stat .as-ico svg { width: 18px; height: 18px; }
.admin-stat .as-value { font-size: 27px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.admin-stat .as-sub { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; }

.admin-grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.panel {
  background: linear-gradient(165deg, rgba(15, 28, 54, 0.6), rgba(8, 16, 33, 0.75));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.panel-head h3 svg { width: 16px; height: 16px; color: var(--blue); }
.panel-head .ph-link { font-size: 11.5px; color: var(--blue); font-weight: 700; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  padding: 15px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(13, 24, 48, 0.5); transition: all 0.2s;
}
.quick-action:hover { border-color: rgba(56, 189, 248, 0.35); background: rgba(56, 189, 248, 0.06); transform: translateY(-2px); }
.quick-action .qa-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(56, 189, 248, 0.1); color: var(--blue); }
.quick-action .qa-ico.green { background: rgba(52, 211, 153, 0.1); color: var(--green); }
.quick-action .qa-ico.orange { background: rgba(251, 146, 60, 0.1); color: var(--orange); }
.quick-action .qa-ico.purple { background: rgba(167, 139, 250, 0.1); color: #a78bfa; }
.quick-action .qa-ico svg { width: 17px; height: 17px; }
.quick-action .qa-label { font-size: 12.5px; font-weight: 700; }
.quick-action .qa-sub { font-size: 10.5px; color: var(--muted-2); }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th {
  text-align: start; font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--muted-2); text-transform: uppercase;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 33, 0.5); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(148, 197, 255, 0.06); font-size: 12.5px; vertical-align: middle; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(56, 189, 248, 0.035); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-app { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cell-app .ca-thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--line); }
.cell-app .ca-thumb.thumb-fallback { font-size: 15px; border-radius: 9px; }
.cell-app .ca-name { font-size: 12.5px; font-weight: 700; line-height: 1.4; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-app .ca-sub { font-size: 10.5px; color: var(--muted-2); }
.table-actions { display: flex; align-items: center; gap: 5px; }
.table-btn {
  width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(13, 24, 48, 0.5); color: var(--muted);
  transition: all 0.15s;
}
.table-btn svg { width: 14px; height: 14px; }
.table-btn:hover { color: var(--blue); border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.08); }
.table-btn.danger:hover { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }

.admin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.admin-toolbar .toolbar-search { min-width: 200px; }
.admin-toolbar select { height: 38px; font-size: 12px; min-width: 120px; }

.admin-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.admin-pagination .ap-info { font-size: 11.5px; color: var(--muted-2); }

/* upload */
.upload-zone {
  position: relative; border: 1.5px dashed rgba(96, 165, 250, 0.3);
  border-radius: var(--radius); background: rgba(8, 16, 33, 0.6);
  min-height: 190px; display: grid; place-items: center; text-align: center;
  padding: 20px; cursor: pointer; overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: rgba(56, 189, 248, 0.65); background: rgba(56, 189, 248, 0.05); }
.upload-zone.has-image { padding: 0; border-style: solid; border-color: var(--line-strong); }
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-inner { display: flex; flex-direction: column; align-items: center; gap: 9px; pointer-events: none; }
.upload-inner .up-ico { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: rgba(56, 189, 248, 0.09); color: var(--blue); border: 1px solid rgba(56, 189, 248, 0.18); }
.upload-inner .up-ico svg { width: 22px; height: 22px; }
.upload-inner .up-title { font-size: 13px; font-weight: 700; }
.upload-inner .up-sub { font-size: 11px; color: var(--muted-2); }
.upload-preview { position: relative; width: 100%; aspect-ratio: 16/9; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview .up-actions { position: absolute; bottom: 10px; inset-inline-start: 10px; display: flex; gap: 7px; }
.upload-preview .up-actions .btn { backdrop-filter: blur(10px); background: rgba(5, 10, 22, 0.8); color: #fff; border: 1px solid var(--line-strong); }
.upload-preview .up-actions .btn:hover { background: rgba(56, 189, 248, 0.2); }
.upload-progress { height: 4px; background: rgba(56, 189, 248, 0.12); border-radius: 4px; overflow: hidden; margin-top: 9px; }
.upload-progress > div { height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 4px; transition: width 0.25s; }

/* messages */
.msg-list { display: flex; flex-direction: column; }
.msg-item {
  display: flex; align-items: flex-start; gap: 13px; padding: 15px 18px;
  border-bottom: 1px solid rgba(148, 197, 255, 0.06);
  cursor: pointer; transition: background 0.15s; position: relative;
}
.msg-item:last-child { border-bottom: 0; }
.msg-item:hover { background: rgba(56, 189, 248, 0.04); }
.msg-item.unread { background: rgba(56, 189, 248, 0.045); }
.msg-item.unread::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 2px; background: var(--blue); }
.msg-avatar { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center; background: rgba(56, 189, 248, 0.1); color: var(--blue); font-weight: 800; font-size: 13px; }
.msg-main { flex: 1; min-width: 0; }
.msg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-from { font-size: 12.5px; font-weight: 800; }
.msg-email { font-size: 10.5px; color: var(--muted-2); }
.msg-sub { font-size: 12.5px; color: #cdd9ee; margin-top: 3px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-preview { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-date { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; margin-inline-start: auto; }
.msg-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 8px var(--blue); flex: 0 0 auto; }

.msg-detail { display: flex; flex-direction: column; gap: 16px; }
.msg-detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.msg-detail-body { background: rgba(7, 14, 29, 0.65); border: 1px solid var(--line); border-radius: 11px; padding: 16px; font-size: 13px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; max-height: 46vh; overflow-y: auto; }
.msg-detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.msg-detail-meta .vd { background: rgba(13, 24, 48, 0.5); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.msg-detail-meta .vd .k { font-size: 10px; color: var(--muted-2); }
.msg-detail-meta .vd .v { font-size: 12px; font-weight: 700; margin-top: 2px; word-break: break-all; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.setting-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(148, 197, 255, 0.06); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .sr-ico { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center; background: rgba(56, 189, 248, 0.09); color: var(--blue); }
.setting-row .sr-ico.green { background: rgba(52, 211, 153, 0.09); color: var(--green); }
.setting-row .sr-ico.red { background: rgba(248, 113, 113, 0.1); color: #fca5a5; }
.setting-row .sr-ico svg { width: 16px; height: 16px; }
.setting-row .sr-label { font-size: 12.5px; font-weight: 700; }
.setting-row .sr-value { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; word-break: break-all; }
.setting-row .sr-badge { margin-inline-start: auto; flex: 0 0 auto; }
.checklist { display: flex; flex-direction: column; gap: 9px; }
.check-item { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.check-item .ci-dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: rgba(52, 211, 153, 0.12); color: var(--green); }
.check-item .ci-dot.no { background: rgba(248, 113, 113, 0.1); color: #fca5a5; }
.check-item .ci-dot svg { width: 11px; height: 11px; }

/* ------------------------------ Modal / toast --------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(2, 6, 14, 0.78);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.18s ease;
}
.modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  background: linear-gradient(165deg, #101f3c, #081226);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px -30px #000;
  animation: modalIn 0.22s var(--ease); position: relative;
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #101f3c; z-index: 2; }
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-head p { font-size: 12px; color: var(--muted-2); margin-top: 3px; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: rgba(13, 24, 48, 0.6); color: var(--muted); display: grid; place-items: center; flex: 0 0 auto; }
.modal-close:hover { color: #fff; border-color: var(--line-strong); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.toast-root { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 900; display: flex; flex-direction: column; gap: 9px; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(12, 24, 46, 0.97); backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.5;
  animation: toastIn 0.25s var(--ease);
}
.toast.leaving { animation: toastOut 0.2s ease forwards; }
.toast .t-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; }
.toast .t-ico svg { width: 14px; height: 14px; }
.toast.success .t-ico { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.toast.error .t-ico { background: rgba(248, 113, 113, 0.12); color: #fca5a5; }
.toast.info .t-ico { background: rgba(56, 189, 248, 0.12); color: var(--blue); }
.toast.warning .t-ico { background: rgba(251, 191, 36, 0.12); color: #fcd34d; }
.toast .t-msg { flex: 1; }
.toast .t-close { background: none; border: 0; color: var(--muted-2); padding: 2px; }
.toast .t-close:hover { color: #fff; }
.toast .t-close svg { width: 13px; height: 13px; }

/* ------------------------------ Utilities / states ---------------------- */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.divider { height: 1px; background: var(--line); margin-block: 26px; }
.notice-bar {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 9px 16px; font-size: 12px; text-align: center;
  background: rgba(56, 189, 248, 0.06); border-bottom: 1px solid var(--line); color: #9fb8d8;
}
.notice-bar svg { width: 15px; height: 15px; color: var(--blue); flex: 0 0 auto; }
.notice-bar b { color: var(--blue); }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: currentColor; border-radius: 50%; animation: spin 0.7s linear infinite; flex: 0 0 auto; }
.spinner.lg { width: 26px; height: 26px; border-width: 3px; }
.loading-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: var(--muted); font-size: 13px; }

.error-block {
  text-align: center; padding: 48px 24px; border: 1px solid rgba(248, 113, 113, 0.2);
  background: rgba(248, 113, 113, 0.04); border-radius: var(--radius-lg);
}
.error-block .eb-ico { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 15px; display: grid; place-items: center; background: rgba(248, 113, 113, 0.1); color: #fca5a5; }
.error-block .eb-ico svg { width: 25px; height: 25px; }
.error-block h3 { font-size: 17px; font-weight: 800; margin-bottom: 5px; }
.error-block p { color: var(--muted); font-size: 12.5px; max-width: 44ch; margin: 0 auto 16px; word-break: break-word; }

/* 404 */
.notfound { min-height: 58vh; display: grid; place-items: center; text-align: center; padding: 60px 20px; }
.notfound .nf-code {
  font-size: clamp(90px, 16vw, 160px); font-weight: 900; line-height: 0.9;
  letter-spacing: -6px; background: linear-gradient(180deg, rgba(56, 189, 248, 0.55), rgba(56, 189, 248, 0.05));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.notfound h1 { font-size: 24px; font-weight: 800; margin-top: 10px; }
.notfound p { color: var(--muted); font-size: 13.5px; margin: 8px auto 22px; max-width: 40ch; }

/* ------------------------------ Animations ------------------------------ */

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-16px); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes pulseGlow { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

.fade-up { animation: fadeUp 0.5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 1180px) {
  .main-nav { gap: 0; }
  .main-nav a { padding: 9px 10px; font-size: 13px; }
  .search-box { width: 180px; }
  .app-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .main-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .search-box { width: 100%; max-width: 260px; }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-content { max-width: none; }
  .hero-visual { max-width: 560px; margin-inline: auto; width: 100%; }
  .hero-float.f1 { inset-inline-start: 2%; }
  .hero-float.f2 { inset-inline-end: 2%; }
  .program-layout { grid-template-columns: 1fr; }
  .program-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .program-side .side-card { flex: 1; min-width: 280px; }
  .contact-layout { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed; inset: 0 auto 0 0; width: 270px; height: 100vh;
    transform: translateX(-100%); transition: transform 0.25s var(--ease);
    box-shadow: 0 0 60px rgba(0,0,0,0.6);
  }
  .admin-sidebar.open { transform: none; }
  .admin-burger { display: inline-flex; }
  .admin-content { padding: 20px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .container { padding-inline: 18px; }
  .section { padding-block: 46px; }
  .cat-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .header-actions .header-admin span { display: none; }
  .header-admin { padding: 0 11px; }
  .hero { padding-top: 38px; }
  .hero-float.f3 { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 20px; }
  .program-body { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding: 40px 0 30px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .admin-page-head { align-items: flex-start; }
  .msg-detail-meta { grid-template-columns: 1fr; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 0 16px; }
}

@media (max-width: 540px) {
  :root { --header-h: 66px; }
  body { font-size: 15px; }
  .app-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat-cell { padding: 16px 14px; gap: 10px; }
  .stat-value { font-size: 19px; }
  .stat-ico { width: 38px; height: 38px; border-radius: 10px; }
  .stat-label { font-size: 10.5px; }
  .hero h1 { font-size: 30px; }
  .hero-actions .btn { flex: 1; }
  .hero-points { gap: 12px; }
  .search-box { display: none; }
  .header-admin span { display: none; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-stat { padding: 15px; }
  .admin-stat .as-value { font-size: 23px; }
  .quick-actions { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; }
  .page-head { padding-top: 32px; }
  .catalog-toolbar { padding: 12px; }
  .select-wrap, .select-wrap select { width: 100%; }
  .filter-tabs { width: 100%; overflow-x: auto; }
  .filter-tabs a, .filter-tabs button { flex: 1; text-align: center; }
  .program-cover { aspect-ratio: 16/10; }
  .program-side { flex-direction: column; }
  .program-side .side-card { min-width: 0; }
  .modal-body, .modal-head, .modal-foot { padding-inline: 16px; }
  .toast-root { inset-inline: 14px; bottom: 14px; max-width: none; }
}

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


/* ============================================================================
   Fixes + preferences (language direction, light theme)
   ========================================================================== */

/* Inline SVG icons must never fall back to their intrinsic (huge) size. */
:where(svg[viewBox="0 0 24 24"]:not([width])) { width: 1.25em; height: 1.25em; flex: 0 0 auto; }
.field-error svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* Language / theme buttons in the header */
.header-tool {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 11px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: rgba(13, 24, 48, 0.55);
  color: var(--muted); font-size: 12.5px; font-weight: 800; line-height: 1;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.header-tool:hover { color: var(--blue); border-color: rgba(56, 189, 248, 0.5); background: rgba(56, 189, 248, 0.08); }
.header-tool svg { width: 18px; height: 18px; }

/* Left-to-right (English) — directional arrows and chevrons must flip */
html[dir="ltr"] .link-arrow svg,
html[dir="ltr"] .cat-link svg,
html[dir="ltr"] .search-result > svg,
html[dir="ltr"] .search-pop-foot svg,
html[dir="ltr"] .app-foot .btn-icon svg,
html[dir="ltr"] .page-btn svg { transform: scaleX(-1); }
html[dir="ltr"] .breadcrumb svg { transform: none; }
html[dir="ltr"] .cat-card:hover .cat-link svg { transform: scaleX(-1) translateX(-4px); }
html[dir="ltr"] .field-error,
html[dir="ltr"] .alert { text-align: left; }

/* ------------------------------- Light theme ------------------------------ */

html[data-theme="light"] {
  --bg: #f3f7fd;
  --bg-2: #e9f0fa;
  --bg-3: #dde8f6;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-2: rgba(238, 244, 253, 0.95);
  --line: rgba(30, 64, 120, 0.15);
  --line-strong: rgba(14, 100, 180, 0.34);
  --text: #0f1b33;
  --muted: #475a7c;
  --muted-2: #6b7d9d;
  --blue: #0284c7;
  --blue-2: #0891b2;
  --blue-deep: #0369a1;
  --green: #059669;
  --green-2: #16a34a;
  --orange: #ea580c;
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.09);
  --warning: #b45309;
  --shadow: 0 24px 60px -28px rgba(30, 64, 120, 0.35);
  --shadow-blue: 0 18px 50px -18px rgba(2, 132, 199, 0.35);
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 55% 40% at 85% -5%, rgba(56, 189, 248, 0.22), transparent 60%),
    radial-gradient(ellipse 45% 35% at 5% 15%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(ellipse 50% 45% at 50% 110%, rgba(52, 211, 153, 0.12), transparent 65%),
    linear-gradient(180deg, #f6f9fe 0%, #eef3fb 50%, #f3f7fd 100%);
}
html[data-theme="light"] body::after {
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(30, 64, 120, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 64, 120, 0.05) 1px, transparent 1px);
}
html[data-theme="light"] ::selection { background: rgba(2, 132, 199, 0.28); color: #0f1b33; }
html[data-theme="light"] ::-webkit-scrollbar-track { background: #e9f0fa; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #b7c8e3; border-color: #e9f0fa; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #9db4d6; }

html[data-theme="light"] .gradient-text {
  background: linear-gradient(100deg, #0369a1 0%, #0284c7 40%, #0891b2 70%, #059669 100%);
  -webkit-background-clip: text; background-clip: text;
}

/* Header, menus, footer */
html[data-theme="light"] .site-header { background: rgba(255, 255, 255, 0.78); }
html[data-theme="light"] .site-header.scrolled { background: rgba(255, 255, 255, 0.92); box-shadow: 0 12px 40px -22px rgba(30, 64, 120, 0.35); }
html[data-theme="light"] .mobile-nav,
html[data-theme="light"] .search-pop { background: rgba(255, 255, 255, 0.98); }
html[data-theme="light"] .main-nav a:hover,
html[data-theme="light"] .filter-tabs a:hover,
html[data-theme="light"] .filter-tabs button:hover,
html[data-theme="light"] .page-btn:hover:not(:disabled),
html[data-theme="light"] .modal-close:hover,
html[data-theme="light"] .toast .t-close:hover { color: var(--text); }
html[data-theme="light"] .site-footer { background: linear-gradient(180deg, rgba(238, 244, 253, 0.6), #e4ecf8); }

/* Surfaces */
html[data-theme="light"] .stats-strip,
html[data-theme="light"] .stat-cell,
html[data-theme="light"] .cat-card,
html[data-theme="light"] .app-card,
html[data-theme="light"] .program-main,
html[data-theme="light"] .side-card,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .contact-info-card,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .feature-card,
html[data-theme="light"] .hero-float,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .catalog-toolbar,
html[data-theme="light"] .toast {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: 0 14px 36px -22px rgba(30, 64, 120, 0.3);
}
html[data-theme="light"] .stat-cell:hover { background: #f1f6fd; }
html[data-theme="light"] .cta-band { background: linear-gradient(135deg, #e0f0fd, #e6f7f0); }
html[data-theme="light"] .chip,
html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .menu-toggle,
html[data-theme="light"] .header-admin,
html[data-theme="light"] .header-tool,
html[data-theme="light"] .page-btn,
html[data-theme="light"] .footer-social a,
html[data-theme="light"] .back-top,
html[data-theme="light"] .search-box input,
html[data-theme="light"] .input,
html[data-theme="light"] .textarea,
html[data-theme="light"] .select,
html[data-theme="light"] .check-row { background: #ffffff; color: var(--text); }
html[data-theme="light"] .btn-ghost:hover,
html[data-theme="light"] .search-box input:focus,
html[data-theme="light"] .input:focus,
html[data-theme="light"] .textarea:focus,
html[data-theme="light"] .select:focus { background: #f1f6fd; }
html[data-theme="light"] .app-thumb,
html[data-theme="light"] .thumb-fallback,
html[data-theme="light"] .app-card.android .thumb-fallback,
html[data-theme="light"] .program-cover { background: linear-gradient(145deg, #dbeafe, #e0f2fe); color: var(--blue-deep); }
html[data-theme="light"] .app-card.android .thumb-fallback { background: linear-gradient(145deg, #d1fae5, #e0f2fe); color: var(--green); }
html[data-theme="light"] .skeleton {
  background: linear-gradient(100deg, rgba(200, 216, 240, 0.5) 30%, rgba(222, 233, 248, 0.8) 50%, rgba(200, 216, 240, 0.5) 70%);
  background-size: 200% 100%;
}
html[data-theme="light"] .program-desc .prose { color: #25365a; }
html[data-theme="light"] .field label { color: #2b3d63; }
html[data-theme="light"] .field-error { color: #b91c1c; }

/* Alerts */
html[data-theme="light"] .alert-info { color: #075985; background: rgba(2, 132, 199, 0.09); border-color: rgba(2, 132, 199, 0.28); }
html[data-theme="light"] .alert-success { color: #166534; }
html[data-theme="light"] .alert-error { color: #991b1b; }
html[data-theme="light"] .alert-warning { color: #92400e; background: rgba(217, 119, 6, 0.1); border-color: rgba(217, 119, 6, 0.3); }
html[data-theme="light"] .toast.error .t-ico,
html[data-theme="light"] .error-block .eb-ico { color: #b91c1c; }
html[data-theme="light"] .toast.warning .t-ico { color: #b45309; }

/* Light theme: keep the dark chip over cover images readable */
html[data-theme="light"] .thumb-badges .badge,
html[data-theme="light"] .program-cover .cover-badges .badge,
html[data-theme="light"] .thumb-time { color: #e6eefc; }
/* Padding that reserves room for an icon on the "start" side must flip with direction */
html[dir="ltr"] .search-box input { padding: 0 14px 0 38px; }
html[dir="ltr"] .toolbar-search input { padding: 0 14px 0 40px; }
html[dir="ltr"] .select-wrap select { padding: 0 14px 0 38px; }

/* Light theme: text colors that were hard-coded for the dark theme */
html[data-theme="light"] .main-nav a { color: #3b4f74; }
html[data-theme="light"] .main-nav a:hover { background: rgba(2, 132, 199, 0.08); }
html[data-theme="light"] .main-nav a.active { color: var(--blue); }
html[data-theme="light"] .select-wrap select { color: var(--text); background: #ffffff; }
html[data-theme="light"] .toolbar-search input { background: #ffffff; }
html[data-theme="light"] .msg-sub { color: #25365a; }
/* Light theme: pale text colors that only worked on dark backgrounds */
html[data-theme="light"] .badge-blue { color: #0369a1; }
html[data-theme="light"] .badge-green { color: #047857; }
html[data-theme="light"] .badge-orange { color: #c2410c; }
html[data-theme="light"] .badge-red { color: #b91c1c; }
html[data-theme="light"] .badge-yellow { color: #a16207; }
html[data-theme="light"] .thumb-badges .badge-blue,
html[data-theme="light"] .cover-badges .badge-blue { color: #7dd3fc; }
html[data-theme="light"] .thumb-badges .badge-green,
html[data-theme="light"] .cover-badges .badge-green { color: #6ee7b7; }
html[data-theme="light"] .thumb-badges .badge-yellow,
html[data-theme="light"] .cover-badges .badge-yellow { color: #fcd34d; }
html[data-theme="light"] .thumb-badges .badge-muted,
html[data-theme="light"] .cover-badges .badge-muted { color: #cbd5e1; }
html[data-theme="light"] .btn-soft,
html[data-theme="light"] .link-arrow:hover { color: #0369a1; }
html[data-theme="light"] .header-admin,
html[data-theme="light"] .mobile-nav a { color: #3b4f74; }
html[data-theme="light"] .info-row .v,
html[data-theme="light"] .footer-col h4 { color: var(--text); }
html[data-theme="light"] .btn-danger { color: #b91c1c; }
/* Download counter badge beside each app title */
.app-head-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.app-head-row .app-title { flex: 1; min-width: 0; }
.app-dl-badge {
  display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
  font-size: 11.5px; font-weight: 700; line-height: 1;
  color: var(--blue);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 5px 9px; border-radius: 8px;
  white-space: nowrap;
}
.app-card.android .app-dl-badge {
  color: var(--green);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.25);
}
.app-dl-badge svg { width: 12px; height: 12px; flex: 0 0 auto; }
html[data-theme="light"] .app-dl-badge {
  color: #0369a1;
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.28);
}
html[data-theme="light"] .app-card.android .app-dl-badge {
  color: #047857;
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.28);
}