/* ==========================================================================
   ANDRO PORTAL · две темы: "Nebula" (тёмная, фиолетово-розовая)
                             и "Sunrise" (светлая, сине-оранжевая)
   Подключается ПОСЛЕ engine.css, styl2.css и reset.css (см. main.tpl).
   Переключение: класс на <html>:  theme-dark  /  theme-light
   Все цвета — только в двух блоках переменных ниже.
   ========================================================================== */

:root,
html.theme-dark {
  --bg: #0b0a14;
  --bg-soft: #100e1e;
  --surface: #151329;
  --surface-2: #1d1a38;
  --surface-3: #282450;
  --border: #2b2754;
  --text: #f0ecff;
  --text-2: #c9c4e6;
  --muted: #8f8ab8;

  --accent: #7c5cff;
  --accent-2: #ff5ca8;
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #7c5cff 0%, #b24cf0 55%, #ff5ca8 100%);
  --accent-soft: rgba(124, 92, 255, .16);
  --accent-line: rgba(124, 92, 255, .55);
  --hot: #ffb454;

  --glass: rgba(11, 10, 20, .78);
  --shadow: 0 14px 40px rgba(0, 0, 0, .45);
  --glow: 0 0 0 1px var(--accent-line), 0 14px 38px rgba(124, 92, 255, .22);
  --zebra: rgba(255, 255, 255, .03);
  --danger: #ff6b81;

  --hero: radial-gradient(900px 340px at 85% -20%, rgba(255, 92, 168, .38), transparent 60%),
          radial-gradient(700px 320px at 0% 120%, rgba(124, 92, 255, .45), transparent 60%),
          linear-gradient(135deg, #17133a, #1d1445);
  color-scheme: dark;
}

html.theme-light {
  --bg: #f3f5fb;
  --bg-soft: #eaeef8;
  --surface: #ffffff;
  --surface-2: #f2f5fc;
  --surface-3: #e2e8f6;
  --border: #dce3f2;
  --text: #0e1530;
  --text-2: #34406a;
  --muted: #667295;

  --accent: #2563eb;
  --accent-2: #ff8a3d;
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #1d4ed8 0%, #2f7bf5 55%, #19b5ee 100%);
  --accent-soft: rgba(37, 99, 235, .10);
  --accent-line: rgba(37, 99, 235, .5);
  --hot: #ff8a3d;

  --glass: rgba(255, 255, 255, .86);
  --shadow: 0 12px 30px rgba(20, 34, 80, .10);
  --glow: 0 0 0 1px var(--accent-line), 0 14px 32px rgba(37, 99, 235, .16);
  --zebra: rgba(14, 21, 48, .03);
  --danger: #e5384f;

  --hero: radial-gradient(800px 320px at 90% -30%, rgba(255, 138, 61, .55), transparent 60%),
          radial-gradient(700px 300px at 0% 130%, rgba(25, 181, 238, .45), transparent 60%),
          linear-gradient(135deg, #1e4fd8, #2f7bf5);
}

:root {
  --r: 18px;
  --r-lg: 26px;
  --gap: 16px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}


/* ---------- БАЗА ---------- */
html { scroll-behavior: smooth; }
html body {
  margin: 0; padding: 0; min-width: 320px;
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg); background-image: none;
  -webkit-font-smoothing: antialiased;
}
html body a { color: inherit; text-decoration: none; }
html body b, html body strong, html body th { font-family: inherit; font-weight: 700; }
html body img { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ap-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.ap-main { padding-top: 22px; padding-bottom: 56px; min-height: 60vh; }


/* ---------- ШАПКА ---------- */
.ap-top {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid var(--border);
}
.ap-top-in { display: flex; align-items: center; gap: 18px; height: 66px; }

.ap-logo { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--text); }
.ap-logo-mark {
  width: 38px; height: 38px; border-radius: 12px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 8px 20px rgba(124, 92, 255, .35);
}
.ap-logo-mark svg { width: 22px; height: 22px; display: block; }
.ap-logo-text b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }

.ap-search { position: relative; flex: 1 1 auto; max-width: 640px; margin: 0 auto; }
.ap-search form { position: relative; display: block; margin: 0; }
.ap-search input.searchform {
  display: block; width: 100%; height: 44px; padding: 0 18px 0 48px; box-sizing: border-box;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: 500 14.5px var(--font); transition: border-color .15s, box-shadow .15s;
}
.ap-search input.searchform:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ap-search input.searchform::placeholder { color: var(--muted); opacity: 1; }
.ap-search button.searchbt {
  position: absolute; left: 4px; top: 4px; width: 36px; height: 36px; padding: 0; border: 0; cursor: pointer;
  border-radius: 50%; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center;
}
.ap-search button.searchbt:hover { color: var(--accent); }
.ap-search button.searchbt svg { width: 19px; height: 19px; }




/* ---------- БУРГЕР (виден только на узких экранах) ---------- */
.ap-burger {
  display: none; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; cursor: pointer; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  align-items: center; justify-content: center; transition: border-color .15s, color .15s, background .15s;
}
.ap-burger:hover { border-color: var(--accent-line); color: var(--accent); }
.ap-burger svg { width: 22px; height: 22px; }
.ap-burger .ic-close { display: none; }
html.ap-menu-open .ap-burger { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
html.ap-menu-open .ap-burger .ic-open { display: none; }
html.ap-menu-open .ap-burger .ic-close { display: block; }

/* ---------- РЕЙЛ КАТЕГОРИЙ ---------- */
.ap-rail { border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.ap-rail-in { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.ap-rail a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: all .15s ease;
}
.ap-rail a:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.ap-rail a.is-home { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }


/* ---------- HERO (только главная) ---------- */
.ap-hero {
  position: relative; overflow: hidden; margin-bottom: 26px; padding: 34px 36px;
  border-radius: var(--r-lg); background: var(--hero); color: #fff; box-shadow: var(--shadow);
}
.ap-hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  border: 38px solid rgba(255, 255, 255, .08); pointer-events: none;
}
.ap-hero-title { position: relative; font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -.025em; max-width: 640px; }
.ap-hero-sub { position: relative; margin-top: 10px; font-size: 16px; color: rgba(255, 255, 255, .82); max-width: 600px; }

.speedbar { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.speedbar a { color: var(--muted); }
.speedbar a:hover { color: var(--accent); }


/* ---------- СЕТКА КАРТОЧЕК ---------- */
#dle-content, .ap-grid { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: stretch; }
#dle-content > *, .ap-grid > * { flex: 0 0 100%; min-width: 0; box-sizing: border-box; }
#dle-content > .ap-card, .ap-grid > .ap-card { flex: 0 0 calc((100% - 2 * var(--gap)) / 3); }

.ap-card {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.ap-card:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--glow); background: var(--surface-2); }
.ap-card-ico { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 22%; overflow: hidden; background: var(--surface-3); box-shadow: 0 8px 18px rgba(0, 0, 0, .28); }
.ap-card-ico img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ap-card-body { flex: 1 1 auto; min-width: 0; }
.ap-card-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.ap-card-title a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.ap-card:hover .ap-card-title a { color: var(--accent); }
.ap-card-dev { margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.ap-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; line-height: 1.35; max-width: 100%;
}
.ap-chip-ver { background: var(--accent-soft); color: var(--accent); }
html.theme-dark .ap-chip-ver { color: #b4a2ff; }

.ap-card-go {
  position: relative; z-index: 1; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; background: var(--grad); color: var(--accent-ink);
  box-shadow: 0 8px 18px rgba(124, 92, 255, .3); transition: transform .18s ease;
}
html.theme-light .ap-card-go { box-shadow: 0 8px 18px rgba(37, 99, 235, .28); }
.ap-card:hover .ap-card-go { transform: scale(1.08); }
.ap-card-go::before {
  content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11m0 0l-5-5m5 5l5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11m0 0l-5-5m5 5l5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ap-sec-title { margin: 34px 0 16px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.ap-sec-title::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 12px; border-radius: 50%; background: var(--grad); vertical-align: middle; }
.ap-related { margin-top: 36px; }
.ap-related .ap-sec-title { margin-top: 0; }


/* ---------- ПАГИНАЦИЯ ---------- */
html body .cat-news { margin: 0; padding: 0; }
.bottom-nav { height: auto; min-height: 0; margin: 0; padding: 0; background: transparent; }
.bottom-nav:empty { display: none; }
html body .pagi-nav { background: transparent; box-shadow: none; border: 0; }
.pagi-nav .navigation, .pagi-nav .navigation > *, .pagi-nav .pnext, .pagi-nav .pnext > * { margin: 0 !important; }
.pagi-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 26px 0 6px; }
.pagi-nav br { display: none; }
.pagi-nav .navigation { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagi-nav .navigation a, .pagi-nav .navigation span, .pagi-nav .pnext a, .pagi-nav .pnext span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 14px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 15px; font-weight: 700; transition: all .15s ease; box-sizing: border-box;
}
.pagi-nav .navigation a:hover, .pagi-nav .pnext a:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pagi-nav .navigation > span { background: var(--grad); border-color: transparent; color: var(--accent-ink); }
.pagi-nav .navigation span.nav_ext { background: transparent; border-color: transparent; color: var(--muted); }


/* ---------- СТРАНИЦА ПРИЛОЖЕНИЯ ---------- */
.ap-app-head {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 24px; padding: 26px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
}
.ap-app-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background: radial-gradient(520px 200px at 0% 0%, var(--accent-soft), transparent 70%);
}
.ap-app-ico { position: relative; flex: 0 0 auto; width: 132px; height: 132px; border-radius: 24%; overflow: hidden; box-shadow: 0 16px 36px rgba(0, 0, 0, .4); background: var(--surface-3); }
.ap-app-ico img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ap-app-titles { position: relative; min-width: 0; }
.ap-app-titles h1 { margin: 0; font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -.03em; color: var(--text); }
.ap-app-dev { margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--accent); }
html.theme-dark .ap-app-dev { color: #b4a2ff; }
.ap-app-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ap-app-chips .ap-chip { font-size: 13px; padding: 5px 12px; }

.ap-app-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; margin-top: 22px; align-items: start; }
.ap-app-side { position: sticky; top: 90px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }

.ap-dl { display: flex; flex-direction: column; gap: 10px; }
.ap-dl a { display: block; }
.ap-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 12px 20px; box-sizing: border-box;
  border-radius: 14px; font-size: 16px; font-weight: 800; line-height: 1.2; text-align: center; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, background .16s ease, border-color .16s ease;
}
.ap-btn-main { background: var(--grad); color: var(--accent-ink); box-shadow: 0 12px 26px rgba(124, 92, 255, .32); }
html.theme-light .ap-btn-main { box-shadow: 0 12px 26px rgba(37, 99, 235, .3); }
.ap-btn-main::before {
  content: ""; flex: 0 0 auto; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11m0 0l-5-5m5 5l5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11m0 0l-5-5m5 5l5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ap-dl a:hover .ap-btn-main { transform: translateY(-2px); filter: brightness(1.08); }
.ap-btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); font-weight: 700; }
.ap-dl a:hover .ap-btn-ghost { border-color: var(--accent-line); color: var(--accent); transform: translateY(-2px); }

.ap-facts { list-style: none; margin: 18px 0 0; padding: 0; }
.ap-facts li { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 11px 0; border-top: 1px solid var(--border); font-size: 14px; }
.ap-facts li span { color: var(--muted); flex: 0 0 auto; }
.ap-facts li b { text-align: right; color: var(--text); overflow-wrap: anywhere; }


/* ---------- ВКЛАДКИ ---------- */
.tabbable { min-width: 0; }
.nav-tabs {
  display: flex; gap: 6px; margin: 0 0 16px; padding: 6px; list-style: none; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs li {
  flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 11px;
  font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s, color .15s;
}
.nav-tabs li:hover { color: var(--text); background: var(--surface-2); }
.nav-tabs li.active { background: var(--grad); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(124, 92, 255, .28); }
html.theme-light .nav-tabs li.active { box-shadow: 0 6px 16px rgba(37, 99, 235, .26); }
.nav-tabs li .fa { opacity: .85; }

.tab-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; min-height: 160px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.descr { font-size: 15.5px; line-height: 1.75; color: var(--text-2); overflow-wrap: anywhere; }
.descr h1, .descr h2, .descr h3, .descr h4 { color: var(--text); font-weight: 800; letter-spacing: -.015em; line-height: 1.25; margin: 28px 0 12px; }
.descr > :first-child { margin-top: 0; }
.descr h2 { font-size: 24px; }
.descr h3 { font-size: 19px; }
.descr p { margin: 0 0 14px; }
.descr a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
html.theme-dark .descr a { color: #b4a2ff; }
.descr b, .descr strong { color: var(--text); }
.descr img { border-radius: 14px; height: auto; }
.descr ul { list-style: none; margin: 16px 0; padding: 0; }
.descr ul li { position: relative; margin: 0 0 11px; padding-left: 28px; }
.descr ul li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px var(--accent-soft); }
.descr ol { margin: 16px 0; padding-left: 22px; list-style: decimal; }
.descr ol li { margin-bottom: 10px; padding-left: 4px; }
.descr table { width: 100%; margin: 22px 0; border-collapse: collapse; font-size: 14.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.descr table th { padding: 12px 16px; text-align: left; background: var(--surface-3); color: var(--text); }
.descr table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.descr table tbody tr:nth-of-type(even) { background: var(--zebra); }
.descr table tr:last-child td { border-bottom: 0; }

.ap-shots { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.ap-shots::-webkit-scrollbar { height: 8px; }
.ap-shots::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
.ap-shots a, .ap-shots > img { flex: 0 0 auto; scroll-snap-align: start; display: block; }
.ap-shots img { display: block; height: 320px; width: auto; max-width: 82vw; object-fit: contain; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); }

.youtube { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background-position: center; background-repeat: no-repeat; background-size: cover; cursor: pointer; box-shadow: var(--shadow); }
.youtube .play {
  position: absolute; top: 50%; left: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transition: transform .18s ease;
}
.youtube .play::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -11px 0 0 -7px; border-style: solid; border-width: 11px 0 11px 19px; border-color: transparent transparent transparent #fff; }
.youtube:hover .play { transform: scale(1.1); }
.ap-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 16px; }



/* перебиваем старые стили табов из styl2.css (там есть !important) */
html body .tabbable > .nav-tabs { display: flex; gap: 6px; margin: 0 0 16px; padding: 6px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
html body .tabbable > .nav-tabs::before, html body .tabbable > .nav-tabs::after { display: none; }
html body .tabbable > .nav-tabs > li {
  float: none !important; width: auto; flex: 1 0 auto; margin: 0; padding: 0 18px; height: 42px; line-height: 1.2;
  display: flex; align-items: center; justify-content: center;
  border: 0 !important; border-radius: 11px !important; background: transparent; color: var(--muted);
}
html body .tabbable > .nav-tabs > li:hover { background: var(--surface-2); color: var(--text); border: 0; }
html body .tabbable > .nav-tabs > li.active, html body .tabbable > .nav-tabs > li.active:hover { background: var(--grad); color: var(--accent-ink); border: 0; cursor: default; }
html body .tabbable .tab-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; }
html body .tab-content > .tab-pane { font-size: inherit; line-height: inherit; text-align: left; }
html body .tab-pane img { border: 0; margin: 0; }
html body .tab-pane .ap-shots img { border: 1px solid var(--border); }
html body .tab-pane iframe, html body .tab-pane .youtube-frame { width: 100%; height: auto !important; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 16px; }
@media (max-width: 640px) { html body .tabbable .tab-content { padding: 18px 16px; } }


/* ---------- ПОДВАЛ ---------- */
.ap-foot { border-top: 1px solid var(--border); background: var(--bg-soft); }
.ap-foot-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 26px; color: var(--muted); font-size: 14px; }
.ap-up { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; }
.ap-up:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }


/* ---------- СОВМЕСТИМОСТЬ: системные блоки DLE ---------- */
.berrors { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: rgba(255, 180, 84, .12); border: 1px solid rgba(255, 180, 84, .4); color: var(--text); }
.berrors img { width: 28px; height: 28px; }
html body input[type="text"], html body input[type="password"], html body textarea, html body select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; font-family: var(--font);
}
html body input[type="submit"], html body input[type="button"], html body button.btn { border-radius: 12px; }
.ui-dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
#searchsuggestions { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
#searchsuggestions a { color: var(--text); }
#searchsuggestions a:hover { background: var(--surface-2); color: var(--accent); }


/* ---------- АДАПТИВ ---------- */
@media (max-width: 1100px) {
  #dle-content > .ap-card, .ap-grid > .ap-card { flex-basis: calc((100% - var(--gap)) / 2); }
  .ap-app-cols { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 860px) {
  .ap-burger { display: inline-flex; }
  .ap-rail {
    display: none; position: fixed; left: 0; right: 0; top: 66px; z-index: 99;
    max-height: calc(100vh - 66px); overflow-y: auto; -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  html.ap-menu-open .ap-rail { display: block; }
  .ap-wrap.ap-rail-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 14px; padding-bottom: 16px; }
  .ap-rail a { height: 44px; justify-content: center; padding: 0 10px; white-space: normal; text-align: center; line-height: 1.15; }
  .ap-app-cols { display: flex; flex-direction: column; }
  .ap-app-cols > * { min-width: 0; max-width: 100%; }
  .ap-app-main { width: 100%; }
  .ap-app-side { order: -1; position: static; width: 100%; box-sizing: border-box; }
  .ap-hero { padding: 26px 22px; }
  .ap-hero-title { font-size: 25px; }
}

@media (max-width: 640px) {
  .ap-wrap { padding: 0 14px; }
  .ap-top-in { height: 60px; gap: 10px; }
  .ap-rail { top: 60px; max-height: calc(100vh - 60px); }
  .ap-logo-text { display: none; }
  .ap-main { padding-top: 16px; }
  #dle-content > .ap-card, .ap-grid > .ap-card { flex-basis: 100%; }
  .ap-app-head { padding: 18px; gap: 16px; align-items: flex-start; }
  .ap-app-ico { width: 92px; height: 92px; }
  .ap-app-titles h1 { font-size: 22px; }
  .ap-app-dev { font-size: 14px; margin-top: 6px; }
  .ap-app-chips { margin-top: 10px; }
  .tab-content { padding: 18px 16px; }
  .descr { font-size: 15px; }
  .descr h2 { font-size: 21px; }
  .descr table { font-size: 13.5px; }
  .descr table th, .descr table td { padding: 10px 12px; }
  .ap-shots img { height: 250px; }
  .ap-sec-title { font-size: 20px; }
  .ap-foot-in { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
