:root {
  --ak-bg: #0b1220;
  --ak-bg-soft: #121c2f;
  --ak-bg-deep: #020617;
  --ak-panel: rgba(18, 28, 47, 0.96);
  --ak-panel-soft: rgba(10, 16, 28, 0.86);
  --ak-card-gradient: linear-gradient(180deg, rgba(18, 28, 47, 0.96), rgba(10, 16, 28, 0.98));
  --ak-hero-gradient: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(2, 6, 23, 0.84));
  --ak-line: rgba(148, 163, 184, 0.22);
  --ak-accent: #38bdf8;
  --ak-accent-2: #2563eb;
  --ak-text: #e2e8f0;
  --ak-muted: #94a3b8;
  --ak-success: #10b981;
  --ak-danger: #f43f5e;
  --ak-gold: #fbbf24;
  --ak-shadow: 0 18px 42px rgba(2, 6, 23, 0.46);
  --primary: var(--ak-bg) !important;
  --bg: var(--ak-bg) !important;
  --panel: var(--ak-bg-soft) !important;
  --panel2: #17233a !important;
  --line: var(--ak-line) !important;
  --accent: var(--ak-accent) !important;
  --text: var(--ak-text) !important;
  --txt: var(--ak-text) !important;
  --muted: var(--ak-muted) !important;
  --white: #ffffff !important;
  --gray: var(--ak-muted) !important;
  --card-bg: rgba(18, 28, 47, 0.96) !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.62) transparent;
}

body {
  background:
    radial-gradient(circle at 82% 2%, rgba(14, 165, 233, 0.18), transparent 36%),
    radial-gradient(circle at 10% 16%, rgba(59, 130, 246, 0.14), transparent 30%),
    var(--ak-bg) !important;
  background-attachment: fixed !important;
  color: var(--ak-text) !important;
  min-height: 100vh;
}

body::before {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  pointer-events: none !important;
  background-image:
    linear-gradient(126deg, transparent 0 18%, rgba(56, 189, 248, 0.08) 18.3%, transparent 18.8%, transparent 34%, rgba(56, 189, 248, 0.07) 34.3%, transparent 34.9%, transparent 54%, rgba(56, 189, 248, 0.06) 54.3%, transparent 54.9%),
    radial-gradient(circle at 7% 38%, rgba(56, 189, 248, 0.34) 0 2px, transparent 3px),
    radial-gradient(circle at 27% 44%, rgba(56, 189, 248, 0.28) 0 2px, transparent 3px),
    radial-gradient(circle at 46% 48%, rgba(56, 189, 248, 0.26) 0 2px, transparent 3px),
    radial-gradient(circle at 66% 41%, rgba(56, 189, 248, 0.24) 0 2px, transparent 3px) !important;
  opacity: 0.34 !important;
  z-index: 0 !important;
}

body::after {
  display: none !important;
}

body > * {
  position: relative;
  z-index: 1;
}

body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.82), rgba(37, 99, 235, 0.52));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.navbar,
.nav,
.header,
.top,
.hero,
.panel,
.sidebar-header,
.sidebar,
.chat-header,
.profile-header,
.search-panel,
.card,
.card-glass,
.content-section,
.post,
.dump-card,
.section-row,
.sections-box,
.shop-sidebar,
.chat-footer,
.form-card,
.ticket-card,
table,
.compact-table-wrap {
  border-color: var(--ak-line) !important;
}

.navbar,
.nav,
.hero,
.banner,
.market-hero,
.panel,
.card,
.card-glass,
.content-section,
.post,
.dump-card,
.form-card,
.ticket-card,
.shop-sidebar,
.sections-box,
.compact-table-wrap,
.news-card,
.timeline,
.review-item,
.product-card,
.master-card {
  background: var(--ak-card-gradient) !important;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.45) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--ak-line) !important;
}

.hero,
.market-hero,
.page-hero,
.profile-header,
.navbar {
  background: var(--ak-hero-gradient) !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.38) !important;
}

.hero,
.page-hero,
.market-hero {
  border-radius: 18px !important;
}

.card,
.card-glass,
.content-section,
.post,
.dump-card,
.form-card,
.ticket-card,
.news-card,
.timeline,
.panel,
.sections-box,
.compact-table-wrap {
  border-radius: 14px !important;
}

.btn,
button.btn,
.btn-primary,
.btn-ok,
.btn-action,
.btn-send,
.chat-search-btn,
input[type="submit"],
button[type="submit"] {
  background: linear-gradient(135deg, var(--ak-accent), var(--ak-accent-2)) !important;
  color: #fff !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.32);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.btn:hover,
button.btn:hover,
.btn-primary:hover,
.btn-ok:hover,
.btn-action:hover,
.btn-send:hover,
.chat-search-btn:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.42);
}

input,
select,
textarea {
  background-color: rgba(11, 18, 34, 0.85) !important;
  border-color: var(--ak-line) !important;
  color: var(--ak-text) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.62) !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16) !important;
  outline: none !important;
}

table {
  background: rgba(10, 16, 28, 0.75) !important;
}

th {
  color: var(--ak-muted) !important;
  background: rgba(2, 6, 23, 0.55) !important;
}

td {
  border-color: rgba(148, 163, 184, 0.12) !important;
}

h1,
h2,
h3,
h4,
.section-title {
  color: #f8fafc !important;
}

.muted,
small,
.meta {
  color: var(--ak-muted) !important;
}

.badge,
.tag,
.pill,
.status-pill {
  border-color: rgba(56, 189, 248, 0.45) !important;
  color: #bae6fd !important;
  background: rgba(56, 189, 248, 0.14) !important;
}

.section-title i,
.category,
.tl-time {
  color: #7dd3fc !important;
}

a { color: #c7e8ff; }

a:hover {
  color: #ffffff;
}

.auth-btn,
.nav-right a,
.nav-links a,
.back-link,
.quick-order-btn,
.corner-user,
.lang-flag,
.category-list a {
  border-color: rgba(56, 189, 248, 0.22) !important;
}

.auth-btn,
.stat-card,
.action-card,
.order-card,
.seller-item,
.master-item,
.log-card,
.user-card,
.info-box,
.review-box,
.message,
.file,
.comment,
.modal-content,
.lightbox-info {
  background: var(--ak-card-gradient) !important;
  border-color: var(--ak-line) !important;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.45) !important;
}

.auth-btn.primary,
.auth-btn:hover,
.nav-right a:hover,
.nav-links a:hover,
.category-list a:hover,
.category-list a.active {
  background: rgba(56, 189, 248, 0.14) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  color: #ffffff !important;
}

.btn-download,
.btn-success,
.success-btn {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
}

.price-tag,
.compact-price,
.success,
.status-success {
  color: var(--ak-success) !important;
}

/* --- Непрочитанные: единый красный счётчик (шапка, чат, форум) --- */
.nav-unread-badge,
.nav-badge,
.unread-badge,
.ak-nav-unread-pill,
.mobile-nav-unread-badge {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid rgba(254, 202, 202, 0.95) !important;
  box-shadow:
    0 0 0 1px rgba(127, 29, 29, 0.45),
    0 4px 12px rgba(220, 38, 38, 0.35) !important;
}

.ak-nav-core {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 16px;
  margin: 0 0 12px 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.55);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ak-nav-core a {
  color: #cbd5e1 !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ak-nav-core a:hover {
  color: #f8fafc !important;
}

/* Мягкая шапка с навигацией (форум «Новая публикация», список разделов и т.д.) */
.ak-page-head-nav {
  padding: 10px 0 0;
  margin: 0 0 12px;
}
.ak-page-head-nav .ak-nav-core {
  margin-top: 0;
  margin-bottom: 0;
  padding: 8px 12px;
  font-size: 11px;
}

/* Форум: блок под навигацией (языки RU/TM) */
.forum-page-head {
  margin-bottom: 2px;
}
.forum-lang-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.forum-lang-strip .lang-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.forum-lang-strip a.lang-flag {
  text-decoration: none;
  width: 34px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}
.forum-lang-strip a.lang-flag::after {
  display: none;
  content: attr(data-code);
}
.forum-lang-strip a.lang-flag:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}
.forum-lang-strip a.lang-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 768px) {
  .forum-lang-strip {
    justify-content: center;
  }
  .forum-lang-strip a.lang-flag {
    width: 34px;
    height: 24px;
  }
  .forum-lang-strip a.lang-flag img {
    display: none;
  }
  .forum-lang-strip a.lang-flag::after {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #e2e8f0;
    line-height: 1;
  }
}

.ak-nav-core-with-pill {
  position: relative;
}

.ak-nav-unread-pill {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-bottom-tab.ak-tab-with-badge {
  position: relative;
}

.mobile-nav-unread-badge {
  position: absolute;
  top: 2px;
  right: 10%;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Компактная шкала загрузки файлов у формы (static/js/ak-file-upload-progress.js) */
.ak-file-upload-inline {
  display: block;
  width: min(280px, 100%);
  max-width: 100%;
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 4px 14px rgba(2, 6, 23, 0.35);
  box-sizing: border-box;
}

.ak-file-upload-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ak-file-upload-inline-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.ak-file-upload-inline-pct {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #7dd3fc;
}

.ak-file-upload-inline-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.ak-file-upload-inline-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  transition: width 0.12s ease-out;
}

.ak-file-upload-inline-hint {
  margin: 6px 0 0;
  font-size: 10px;
  color: #64748b;
  line-height: 1.35;
}

/* Базовая мобильная подстройка: без ломки вёрстки страниц */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}
