/* ═══════════════════════════════════════════════════════════════════════
   SoftMaster — softportal.com proxy
   Yashil-jigarrang klassik dizayn, softportal.com'dan ilhomlangan
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Asosiy ranglar — softportal stilida (yashil + jigarrang) */
  --primary:        #2c7a3e;
  --primary-dark:   #1f5a2c;
  --primary-light:  #e8f3eb;
  --accent:         #d97706;
  --accent-dark:    #b45309;
  --accent-light:   #fff4e6;

  /* Foncha ranglar */
  --bg:             #f5f1e8;
  --bg-card:        #ffffff;
  --bg-soft:        #fdfbf3;
  --bg-hover:       #f0ebe0;

  /* Matnlar */
  --text:           #1f2937;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;

  /* Chiziqlar va shadows */
  --line:           #e5e7eb;
  --line-soft:      #f0eee5;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.05);
  --shadow:         0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg:      0 8px 24px rgba(0,0,0,0.08);

  /* Radiuslar */
  --radius:         6px;
  --radius-md:      8px;
  --radius-lg:      12px;

  /* Boshqalar */
  --container:      1280px;
  --transition:     all 0.2s ease;
  --font-body:      'PT Sans', 'Segoe UI', Tahoma, sans-serif;
  --header-bg:      linear-gradient(135deg, #2c7a3e 0%, #1f5a2c 100%);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    linear-gradient(rgba(245,241,232,0.95), rgba(245,241,232,0.95)),
    url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23d4c9b3' fill-opacity='0.3'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.6em 0;
  color: var(--text);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

/* ─────────── HEADER ─────────── */
.sm-header {
  background: var(--header-bg);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.sm-header__bar {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.sm-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  flex-shrink: 0;
}

.sm-logo:hover { color: #fff; }

.sm-logo__icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
  backdrop-filter: blur(10px);
  font-weight: bold;
}

.sm-logo__text { display: flex; flex-direction: column; line-height: 1.2; }
.sm-logo__name { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.sm-logo__tag  { font-size: 0.78rem; opacity: 0.85; }

.sm-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.sm-search input {
  flex: 1;
  border: 0;
  padding: 11px 16px;
  font-size: 14px;
  background: transparent;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.sm-search button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 0 20px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}
.sm-search button:hover { background: var(--accent-dark); }

.sm-burger {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  display: none;
}

/* ─────────── NAV (OS bo'limlari) ─────────── */
.sm-nav {
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-wrap: wrap;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 8px;
}

.sm-nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}

.sm-nav__item:hover, .sm-nav__item.is-active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.sm-nav__icon { font-size: 16px; }

/* ─────────── SHELL (3-grid layout) ─────────── */
.sm-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px 16px;
}

.sm-shell__grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
}

/* ─────────── SIDEBAR ─────────── */
.sm-sidebar {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  align-self: start;
  position: sticky;
  top: 110px;
}

.sm-sidebar__header {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.sm-sidebar__header::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 16px;
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--primary);
}

.sm-sidebar__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
}

.sm-sidebar__close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: none;
  padding: 0;
}

.sm-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.sm-sidebar__list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text);
  font-size: 0.92rem;
  border-left: 3px solid transparent;
  transition: var(--transition);
}

.sm-sidebar__list a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-left-color: var(--primary);
  padding-left: 18px;
}

.sm-sidebar__icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.sm-sidebar__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.sm-sidebar__top {
  display: block;
  background: var(--accent-light);
  color: var(--accent);
  text-align: center;
  padding: 10px;
  border-radius: var(--radius);
  font-weight: 700;
  border: 1px dashed var(--accent);
  transition: var(--transition);
}

.sm-sidebar__top:hover {
  background: var(--accent);
  color: #fff;
}

/* ─────────── MAIN CONTENT ─────────── */
.sm-shell__main {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-width: 0;
}

/* ─────────── ARCHIVE / LIST PAGE ─────────── */
.sm-archive { display: flex; flex-direction: column; gap: 18px; }

.sm-archive__head {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 12px;
}

.sm-archive__eyebrow {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.sm-archive__title {
  margin: 0 0 4px 0;
  color: var(--primary-dark);
  font-size: 1.5rem;
}

.sm-archive__count {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 4px;
}

.sm-archive__note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.sm-archive__raw {
  /* Asl HTML fallback */
  padding: 20px 0;
}

/* ─────────── ARCHIVE POSTS: LIST VIEW ───────────
   Kichik original ikonka/rasmlar cho'zilmasligi uchun grid kartochka
   o'rniga SoftPortal uslubidagi ixcham gorizontal list ko'rinish berildi. */
.sm-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sm-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: var(--transition);
}

.sm-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.sm-card__link {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.sm-card__link:hover { color: inherit; }

.sm-card__icon {
  width: 88px;
  min-width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  padding: 8px;
}

.sm-card__icon img {
  display: block;
  width: auto;
  height: auto;
  max-width: 72px;
  max-height: 72px;
  object-fit: contain;
}

.sm-card__placeholder {
  font-size: 40px;
  opacity: 0.6;
}

.sm-card__body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.sm-card__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--primary-dark);
}

.sm-card:hover .sm-card__title { color: var(--primary); }

.sm-card__meta {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.sm-card__desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sm-card__btn {
  margin-top: 8px;
  align-self: flex-start;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.sm-card:hover .sm-card__btn { background: var(--accent); }

/* ─────────── SINGLE PAGE (dastur sahifasi) ─────────── */
.sm-single { display: flex; flex-direction: column; gap: 16px; }

.sm-hero {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 14px;
}

.sm-hero__os {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.sm-os-icon { font-size: 1rem; }

.sm-hero__title {
  margin: 4px 0 0;
  color: var(--primary-dark);
  font-size: 1.7rem;
  line-height: 1.25;
}

.sm-single__body {
  line-height: 1.7;
  color: var(--text);
}

.sm-single__body img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 16px 0;
  max-width: 100%;
  height: auto;
}

.sm-single__body h2,
.sm-single__body h3 {
  margin-top: 24px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--primary-dark);
}

.sm-single__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--bg-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.sm-single__body th,
.sm-single__body td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.sm-single__body th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.sm-single__body a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--primary-light);
  text-underline-offset: 3px;
}

.sm-single__body a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Yuklab olish tugmalarini ko'rinarli qilish */
.sm-single__body a[href*="download"],
.sm-single__body a[href*=".exe"],
.sm-single__body a[href*=".dmg"],
.sm-single__body a[href*=".apk"],
.sm-single__body a[href*=".zip"],
.sm-single__body a[href*=".rar"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  margin: 8px 4px 8px 0;
  transition: var(--transition);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(44,122,62,0.25);
}

.sm-single__body a[href*="download"]:hover,
.sm-single__body a[href*=".exe"]:hover,
.sm-single__body a[href*=".dmg"]:hover,
.sm-single__body a[href*=".apk"]:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217,119,6,0.3);
}

.sm-single__body a[href*="download"]::before,
.sm-single__body a[href*=".exe"]::before,
.sm-single__body a[href*=".dmg"]::before,
.sm-single__body a[href*=".apk"]::before,
.sm-single__body a[href*=".zip"]::before {
  content: "⬇";
  font-size: 1.1em;
}

.sm-single__cta {
  background: linear-gradient(135deg, var(--primary-light), #fff);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sm-single__cta-note {
  margin: 0;
  color: var(--primary-dark);
  font-weight: 600;
}

.sm-single__source {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─────────── PAGINATION ─────────── */
/* =====================================================================
 * PAGINATION — ← Oldingi  [1] [2] [3]  Keyingi →
 * ===================================================================== */
.sm-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  padding: 22px 8px 12px;
  border-top: 1px solid var(--line);
}

/* Bazaviy element (link va span) */
.sm-pagination a,
.sm-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .15s ease;
  min-width: 40px;
  user-select: none;
}

.sm-pagination a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Joriy sahifa */
.sm-pagination .sm-pagination__page.is-current,
.sm-pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  cursor: default;
  pointer-events: none;
}

/* Raqamli sahifa */
.sm-pagination__page {
  font-variant-numeric: tabular-nums;
}

/* Oldingi/Keyingi tugmalari */
.sm-pagination__nav {
  padding: 0 16px;
  font-weight: 700;
}
.sm-pagination__prev {
  margin-right: auto;
}
.sm-pagination__next {
  margin-left: auto;
}
.sm-pagination__nav .sm-pagination__nav-text {
  font-size: 0.9rem;
}

/* Faolsiz tugma (boshida/oxirida) */
.sm-pagination .is-disabled {
  background: var(--bg-soft);
  color: var(--text-light);
  border-color: var(--line-soft);
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

/* Mobilda — prev/next ramzlar tashqarida, raqamlar markazda */
@media (max-width: 540px) {
  .sm-pagination {
    gap: 4px;
    padding: 16px 4px 8px;
  }
  .sm-pagination a,
  .sm-pagination span {
    height: 38px;
    padding: 0 10px;
    min-width: 38px;
    font-size: 0.88rem;
  }
  /* Mobilda "Oldingi"/"Keyingi" matnini yashirib, faqat strelka qoldiramiz */
  .sm-pagination__nav-text {
    display: none;
  }
  .sm-pagination__nav {
    padding: 0 12px;
    min-width: 44px;
  }
}

/* ─────────── EMPTY STATE ─────────── */
.sm-empty {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}

.sm-empty p {
  margin: 0;
  color: var(--text-muted);
  max-width: 480px;
  display: inline-block;
}

/* ─────────── FOOTER ─────────── */
.sm-footer {
  margin-top: 40px;
  background: linear-gradient(135deg, #1f2937, #111827);
  color: #d1d5db;
  padding: 36px 0 0;
}

.sm-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.sm-footer__brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.sm-footer__about {
  color: #9ca3af;
  font-size: 0.9rem;
  max-width: 360px;
}

.sm-footer h4 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.sm-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sm-footer li { margin-bottom: 6px; }

.sm-footer li a {
  color: #d1d5db;
  font-size: 0.9rem;
  transition: var(--transition);
}

.sm-footer li a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.sm-footer__bottom {
  margin-top: 28px;
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ─────────── ERROR PAGE ─────────── */
.page--error .sm-shell {
  text-align: center;
  padding-top: 60px;
}

.sm-error {
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.sm-error__title {
  font-size: 1.6rem;
  margin: 0 0 10px;
  color: var(--primary-dark);
}

.sm-error__text {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.sm-error__btn {
  display: inline-block;
  background: var(--primary);
  color: #fff !important;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 700;
}

.sm-error__btn:hover { background: var(--accent); color: #fff !important; }

/* ─────────── MOBILE OVERLAY ─────────── */
.sm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1001;
  display: none;
  animation: smFadeIn 0.2s ease;
}
.sm-overlay.is-active { display: block; }

@keyframes smFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes smSlideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* ─────────── RESPONSIVE: Tablet ─────────── */
@media (max-width: 1024px) {
  .sm-shell__grid {
    grid-template-columns: 220px 1fr;
    gap: 16px;
  }
  .sm-cards {
    gap: 12px;
  }
}

/* ─────────── RESPONSIVE: Mobile ─────────── */
@media (max-width: 760px) {
  .sm-header__bar {
    padding: 10px 12px;
    gap: 12px;
  }
  .sm-burger { display: inline-flex; align-items: center; }
  .sm-search {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
  }
  .sm-logo__name { font-size: 1.15rem; }
  .sm-logo__tag { display: none; }
  .sm-logo__icon { width: 36px; height: 36px; font-size: 18px; }

  .sm-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 0;
  }
  .sm-nav__item {
    padding: 10px 14px;
    flex-shrink: 0;
    font-size: 13px;
  }
  .sm-nav__label {
    display: none;
  }

  .sm-shell {
    padding: 12px 8px;
  }
  .sm-shell__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sm-shell__main {
    padding: 14px;
  }

  .sm-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    height: 100dvh;
    max-height: 100dvh;
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-radius: 0;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0,0,0,0.28);
    will-change: transform;
  }

  .sm-sidebar.is-open {
    transform: translateX(0);
  }

  .sm-sidebar__close {
    display: inline-block;
  }

  .sm-sidebar__list a,
  .sm-sidebar__top {
    min-height: 44px;
    pointer-events: auto;
  }

  body.sm-menu-open {
    overflow: hidden;
    touch-action: none;
  }

  .sm-cards {
    gap: 12px;
  }

  .sm-card__link {
    padding: 12px;
    gap: 12px;
  }

  .sm-card__icon {
    width: 76px;
    min-width: 76px;
    height: 76px;
    padding: 6px;
  }

  .sm-card__icon img {
    max-width: 62px;
    max-height: 62px;
  }

  .sm-card__title { font-size: 0.95rem; }

  .sm-card__desc {
    -webkit-line-clamp: 2;
    font-size: 0.84rem;
  }

  .sm-card__btn {
    font-size: 0.78rem;
    padding: 7px 12px;
  }

  .sm-footer__inner {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .sm-archive__title { font-size: 1.25rem; }
  .sm-hero__title { font-size: 1.4rem; }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }
}

@media (max-width: 420px) {
  body { font-size: 14px; }
  .sm-shell__main { padding: 12px; }

  .sm-card__link {
    gap: 10px;
    padding: 10px;
  }

  .sm-card__icon {
    width: 68px;
    min-width: 68px;
    height: 68px;
  }

  .sm-card__icon img {
    max-width: 56px;
    max-height: 56px;
  }

  .sm-card__title { font-size: 0.9rem; }
  .sm-card__desc { font-size: 0.8rem; }
  .sm-card__btn { font-size: 0.76rem; padding: 6px 10px; }
}

/* ─────────── PRINT ─────────── */
@media print {
  .sm-header, .sm-sidebar, .sm-footer, .sm-burger, .sm-search { display: none !important; }
  .sm-shell__grid { grid-template-columns: 1fr !important; }
  .sm-shell__main { box-shadow: none; border: 0; }
}

/* ─────────── ACCESSIBILITY ─────────── */
a:focus,
button:focus,
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================
 * SINGLE APP PAGE (sm-app) — strukturalangan dizayn
 * ===================================================================== */
.sm-app {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sm-app__hero {
  padding: 24px 28px;
  background: linear-gradient(135deg, #f0f7f2 0%, #fdf9ef 100%);
  border-radius: 12px;
  border-left: 4px solid var(--primary);
}
.sm-app__os {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.sm-app__name {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.25;
}
.sm-app__ver {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  background: #fff4e6;
  padding: 2px 10px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.sm-app__rating {
  font-size: 15px;
  color: #4b5563;
  font-weight: 600;
}
.sm-app__rating span {
  color: #9ca3af;
  font-weight: 400;
  margin-left: 6px;
}

/* Grid: chap (kontent) + o'ng (sidebar info) */
.sm-app__grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .sm-app__grid {
    grid-template-columns: 1fr;
  }
  .sm-app__side { order: -1; }
}

.sm-app__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sm-app__h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

/* Tavsif */
.sm-app__desc-body { line-height: 1.7; color: #1f2937; }
.sm-app__desc-body p { margin: 0 0 12px; }
.sm-app__desc-body b, .sm-app__desc-body strong { color: var(--primary-dark); }
.sm-app__desc-body ul, .sm-app__desc-body ol {
  margin: 8px 0 16px;
  padding-left: 22px;
}
.sm-app__desc-body li { margin: 6px 0; }

/* Skrinshotlar */
.sm-app__screens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.sm-app__screen {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transition: transform .2s, box-shadow .2s;
  background: #f9fafb;
}
.sm-app__screen:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.sm-app__screen img {
  width: 100%;
  height: auto;
  display: block;
}

/* Related dasturlar */
.sm-app__related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.sm-app__related-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.sm-app__related-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.sm-app__related-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  background: #f3f4f6;
}
.sm-app__related-text { min-width: 0; flex: 1; }
.sm-app__related-name {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 14px;
  margin-bottom: 4px;
}
.sm-app__related-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
}

/* Side card (CTA + meta) */
.sm-app__side { position: sticky; top: 16px; }
.sm-app__card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.sm-app__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(44,122,62,0.25);
  transition: transform .15s, box-shadow .2s;
}
.sm-app__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(44,122,62,0.35);
}
.sm-app__cta-icon { font-size: 20px; }
.sm-app__cta-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.sm-app__cta-size {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
}

.sm-app__meta {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 8px 12px;
  margin: 0;
  font-size: 14px;
}
.sm-app__meta dt {
  color: #6b7280;
  font-weight: 500;
}
.sm-app__meta dd {
  margin: 0;
  color: #1f2937;
  font-weight: 600;
  word-break: break-word;
}

/* Manba */
.sm-app__source {
  text-align: center;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
}
.sm-app__source a {
  color: #6b7280;
  font-size: 13px;
  text-decoration: none;
}
.sm-app__source a:hover { color: var(--primary); }

/* ─────────── PRO PATCH: app image, copy, download landing ─────────── */
.sm-app__hero {
  display: flex;
  align-items: center;
  gap: 18px;
}
.sm-app__hero-media {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.sm-app__hero-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}
.sm-app__hero-text { min-width: 0; }
.sm-app__image {
  width: 100%;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-light), #fff);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  overflow: hidden;
}
.sm-app__image img {
  max-width: 140px;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 12px;
}
.sm-copy-btn {
  width: 100%;
  border: 1px dashed var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 16px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.sm-copy-btn:hover {
  background: var(--accent);
  color: #fff;
}

.sm-download-head {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.sm-download-head__brand {
  font-weight: 900;
  color: var(--primary-dark);
  font-size: 1.15rem;
}
.sm-download-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px 48px;
}
.sm-download-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.sm-download-card__image {
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-light), #fff8ec);
  border: 1px solid var(--line);
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.sm-download-card__image img {
  max-width: 190px;
  max-height: 190px;
  object-fit: contain;
  padding: 16px;
}
.sm-download-card__label {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: .82rem;
  margin-bottom: 10px;
}
.sm-download-card h1 {
  color: var(--primary-dark);
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  margin-bottom: 10px;
}
.sm-download-card p { color: var(--text-muted); }
.sm-download-file {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 11px 12px;
  margin: 14px 0;
  word-break: break-word;
}
.sm-download-main {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff !important;
  padding: 15px 20px;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 8px 22px rgba(44,122,62,.25);
  cursor: pointer;
  margin: 6px 0 12px;
}
.sm-download-main:hover { transform: translateY(-1px); color: #fff !important; }
.sm-download-main.is-loading { opacity: .75; pointer-events: none; }
.sm-download-main.is-disabled { opacity: .55; cursor: not-allowed; }
.sm-download-back {
  display: inline-flex;
  margin-top: 4px;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .sm-app__hero { align-items: flex-start; padding: 18px; }
  .sm-app__hero-media { width: 70px; height: 70px; border-radius: 14px; }
  .sm-download-card { grid-template-columns: 1fr; padding: 18px; gap: 16px; }
  .sm-download-card__image { min-height: 180px; }
  .sm-download-head { align-items: flex-start; flex-direction: column; }
}

/* Pro download options: x86/x64/full/online alohida tugmalar */
.sm-download-options {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}
.sm-download-option {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.sm-download-option__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--primary-dark);
}
.sm-download-option__top span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 800;
}
.sm-download-source {
  color: var(--text-muted);
  font-size: .84rem;
  margin-top: -4px;
  word-break: break-word;
}
.sm-download-option .sm-download-file {
  margin: 10px 0;
}
.sm-download-option .sm-download-main {
  margin-bottom: 8px;
}
@media (max-width: 560px) {
  .sm-download-option__top {
    flex-direction: column;
  }
}
/* v6: platformaga mos sidebar OS tablari */
.sm-sidebar__oslinks{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding:12px 14px 6px;
    border-bottom:1px solid rgba(20,83,45,.12);
}
.sm-sidebar__os{
    display:flex;
    align-items:center;
    gap:6px;
    padding:8px 9px;
    border-radius:12px;
    background:#f4f8ef;
    color:#14532d;
    font-weight:800;
    font-size:13px;
    text-decoration:none;
    border:1px solid rgba(20,83,45,.10);
}
.sm-sidebar__os:hover,
.sm-sidebar__os.is-active{
    background:#287d3f;
    color:#fff;
    box-shadow:0 8px 18px rgba(40,125,63,.18);
}


/* ─────────── HOME PAGE: 2 ustunli kompakt ro'yxat ─────────── */
.sm-home { display:flex; flex-direction:column; gap:18px; }
.sm-home__head { border-bottom:2px solid var(--primary); padding-bottom:12px; }
.sm-home__eyebrow { font-size:0.78rem; color:var(--accent); font-weight:700; text-transform:uppercase; letter-spacing:0.04em; margin-bottom:4px; }
.sm-home__title { margin:0 0 6px 0; color:var(--primary-dark); font-size:1.8rem; }
.sm-home__note { margin:0; color:var(--text-muted); font-size:0.92rem; }
.sm-home-section { background:#fff; border:1px solid var(--line); border-radius:var(--radius-md); overflow:hidden; }
.sm-home-section__head { padding:12px 16px; border-bottom:1px solid var(--line); background:#f8faf8; }
.sm-home-section__title { margin:0; font-size:1.25rem; color:var(--primary-dark); }
.sm-home-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:0; }
.sm-home-item { border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.sm-home-item:nth-child(2n) { border-right:0; }
.sm-home-item__link { display:flex; gap:14px; align-items:flex-start; padding:14px; color:inherit; min-height:150px; }
.sm-home-item__link:hover { color:inherit; background:#fcfdfc; }
.sm-home-item__icon { width:76px; height:76px; flex:0 0 76px; display:grid; place-items:center; background:var(--primary-light); border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.sm-home-item__icon img { width:100%; height:100%; object-fit:contain; padding:6px; background:#fff; }
.sm-home-item__placeholder { font-size:34px; opacity:0.6; }
.sm-home-item__body { display:flex; flex-direction:column; gap:6px; min-width:0; }
.sm-home-item__title { margin:0; font-size:1.05rem; line-height:1.35; color:#204f2b; }
.sm-home-item__meta { font-size:0.77rem; color:var(--accent); font-weight:700; }
.sm-home-item__desc { margin:0; color:var(--text); font-size:0.95rem; line-height:1.45; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.sm-home-item__btn { margin-top:auto; display:inline-flex; align-items:center; justify-content:center; align-self:flex-start; background:var(--primary); color:#fff; border-radius:999px; padding:7px 12px; font-size:0.78rem; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; }
.sm-home-item__link:hover .sm-home-item__title { color:var(--primary); }
.sm-home-item__link:hover .sm-home-item__btn { background:var(--accent); }

@media (max-width: 980px) {
  .sm-home-grid { grid-template-columns:1fr; }
  .sm-home-item { border-right:0; }
}
@media (max-width: 760px) {
  .sm-home__title { font-size:1.45rem; }
  .sm-home-item__link { padding:12px; gap:12px; min-height:auto; }
  .sm-home-item__icon { width:64px; height:64px; flex-basis:64px; }
  .sm-home-item__title { font-size:0.98rem; }
  .sm-home-item__desc { font-size:0.84rem; -webkit-line-clamp:2; }
}


/* v9: asosiy sahifada raw SoftPortal matni chiqib ketmasligi uchun kompakt 2 ustunli layout */
.page--home .sm-shell__main { padding: 22px; }
.page--home .sm-home-section { margin-top: 12px; }
.page--home .sm-home-grid { width: 100%; }
.page--home .sm-home-item__link { text-decoration: none; }
@media (min-width: 1200px) {
  .page--home .sm-shell__grid { grid-template-columns: 260px minmax(0, 1fr); }
}


/* v12: pagination — yangi struktura yuqorida (sm-pagination__nav, sm-pagination__page) */

/* =====================================================================
 * BREADCRUMBS — single sahifada navigatsiya
 * ===================================================================== */
.sm-breadcrumbs {
  margin: 0 0 16px;
  font-size: 13px;
}
.sm-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sm-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}
.sm-breadcrumbs li:not(:last-child)::after {
  content: '›';
  margin-left: 8px;
  color: var(--text-light);
}
.sm-breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.sm-breadcrumbs a:hover {
  text-decoration: underline;
}
.sm-breadcrumbs li:last-child span {
  color: var(--text);
  font-weight: 600;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .sm-breadcrumbs li:last-child span { max-width: 220px; }
}
