/* iPadStory 3 — full design system (light editorial store) */

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
  touch-action: manipulation;
}
@media (min-width: 900px) {
  .site-header__actions { display: none }
}
.icon-btn:hover, .icon-btn:focus-visible { background: #efe8dc }

.btn-burger { flex-direction: column; gap: 6px }
.btn-burger__line { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 180ms ease }
.btn-burger.is-open .btn-burger__line:first-child { transform: translateY(4px) rotate(45deg) }
.btn-burger.is-open .btn-burger__line:last-child { transform: translateY(-4px) rotate(-45deg) }

.menu--primary { display: flex; gap: 4px; align-items: center }
.menu__row { display: flex; align-items: center }
.menu a, .menu__link {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  color: var(--muted); font-weight: 600; font-size: .92rem;
}
.menu__item--active > .menu__row > .menu__link,
.menu__item--active > .menu__link,
.menu__link:hover,
.menu .current-cat > a,
.menu a:hover { color: var(--ink); background: #efe8dc }
.menu__arrow { flex-shrink: 0; opacity: .55 }
.menu__count {
  margin-left: auto;
  font-style: normal;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--chip);
  border-radius: 999px;
  min-width: 1.4em;
  padding: 0 7px;
  line-height: 1.5;
  text-align: center;
}
.menu__sub {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 8px; display: none; box-shadow: var(--shadow); z-index: 60;
}
.menu__sub .menu__link {
  width: 100%;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: .9rem;
}
.menu__item { position: relative }
.menu__item--all .menu__link { color: var(--muted); font-weight: 700 }
.menu__dropdown-toggle { display: none }

@media (min-width: 900px) {
  .site-nav { display: block; position: static; background: none; inset: auto; height: auto; overflow: visible }
  .site-nav__top { display: none }
  .menu__item--has-children:hover > .menu__sub,
  .menu__item--has-children:focus-within > .menu__sub { display: block }
}

@media (max-width: 899px) {
  body.nav-open { overflow: hidden }
  .site-header { z-index: 90 }
  .site-nav {
    display: flex;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0; bottom: 0;
    z-index: 80;
    width: 100%;
    margin: 0;
    background: var(--sand);
    padding: 0 0 env(safe-area-inset-bottom, 12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
  }
  .site-nav--mobile-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .site-nav__sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 8px 16px 28px;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 12px;
  }
  .site-nav__title {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 560;
    letter-spacing: -.03em;
  }
  .menu--primary {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .menu__item--has-children,
  .menu__item {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
  }
  .menu__row { width: 100% }
  .menu__link, .menu a {
    flex: 1;
    min-height: 56px;
    padding: 14px 16px;
    border-radius: 18px;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 700;
  }
  .menu__arrow { display: none }
  .menu__dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    min-width: 56px;
    height: 56px;
    border-left: 1px solid var(--line);
    border-radius: 0 18px 18px 0;
    color: var(--ink);
    touch-action: manipulation;
  }
  .menu__dropdown-toggle svg { transition: transform 180ms ease }
  .menu__item.is-open > .menu__row > .menu__dropdown-toggle svg { transform: rotate(180deg) }
  .menu__sub {
    position: static;
    display: none;
    min-width: 0;
    margin: 0 10px 10px;
    padding: 4px;
    border: 0;
    border-radius: 14px;
    background: #f6f0e6;
    box-shadow: none;
  }
  .menu__item.is-open > .menu__sub { display: block }
  .menu__sub .menu__item {
    background: transparent;
    border: 0;
    border-radius: 12px;
  }
  .menu__sub .menu__link {
    min-height: 52px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav, .btn-burger__line, .menu__dropdown-toggle svg { transition: none }
}

.search-overlay {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 40;
  background: rgba(244,240,232,.96); padding: 24px 0;
  opacity: 0; visibility: hidden; transition: opacity var(--fast), visibility var(--fast);
}
.search-overlay.is-open { opacity: 1; visibility: visible }
.search-overlay__close { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center }
.search-overlay .container { display: flex; gap: 12px; align-items: flex-start }
.search-overlay .search-form { flex: 1 }
.search-suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); z-index: 20; padding: 6px; list-style: none;
}
.search-suggestions__link { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink) }
.search-suggestions__link:hover { background: var(--chip) }

.search-form__inner { display: flex; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px }
.search-form__input { flex: 1; border: 0; background: transparent; padding: 10px 14px; min-width: 0 }
.search-form__input:focus { outline: none }
.search-form__btn { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center }
.search-form__btn:hover { background: var(--accent-dark) }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 700;
  transition: transform var(--fast), background var(--fast);
}
.btn:active { transform: scale(.98) }
.btn--primary, .btn--download { background: var(--accent); color: #fff }
.btn--primary:hover, .btn--download:hover { background: var(--accent-dark); color: #fff }
.btn--gplay { background: var(--navy); color: #fff }
.btn--gplay:hover { color: #fff; filter: brightness(1.1) }
.btn--telegram { background: #229ED9; color: #fff }
.btn--telegram:hover { color: #fff }
.btn--lg { min-height: 54px; padding: 0 24px; font-size: 1.05rem }
.btn--outline { border: 1px solid var(--line); background: var(--paper); color: var(--ink) }

.eyebrow {
  display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-dark);
}
.today__visual { border-radius: 22px; overflow: hidden; background: #efe8dc; min-height: 240px }
.today__img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3 }
.today__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 22px; color: var(--muted); font-size: .9rem }
.today__meta span { background: var(--chip); color: var(--ink); padding: 4px 10px; border-radius: 999px; font-weight: 600 }

.shelf { padding: 28px 0 }
.shelf__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px }
.shelf__title { font-size: clamp(1.4rem, 3vw, 1.9rem) }
.shelf__more { font-weight: 700; color: var(--accent-dark) }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none }
.chips::-webkit-scrollbar { display: none }
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 10px 14px; border-radius: 999px; background: var(--paper);
  border: 1px solid var(--line); color: var(--ink); font-weight: 650;
}
.chip em { font-style: normal; color: var(--muted); font-size: .8rem }
.chip:hover { border-color: var(--accent); color: var(--ink) }
.chip--plain { background: var(--chip); border: 0; font-size: .82rem }

.app-icon {
  width: 56px; height: 56px; border-radius: 16px; overflow: hidden;
  background: #efe8dc; flex-shrink: 0; display: grid; place-items: center;
}
.app-icon img, .app-icon__img { width: 100%; height: 100%; object-fit: cover }
.app-icon--sm { width: 44px; height: 44px; border-radius: 12px }
.app-icon--lg { width: 72px; height: 72px; border-radius: 20px }
.app-icon--xl { width: 96px; height: 96px; border-radius: 24px; box-shadow: var(--shadow) }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 640px) { .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px } }
.app-tile {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 14px 14px;
  transition: transform var(--fast), box-shadow var(--fast);
}
.app-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow) }
.app-tile__link { display: flex; flex-direction: column; gap: 8px; color: var(--ink); min-height: 44px }
.app-tile__name { font-size: .98rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.app-tile__sub { color: var(--muted); font-size: .8rem }
.app-tile__rating, .app-tile__chip { font-size: .8rem; font-weight: 700; color: var(--accent-dark) }

.row-list { display: grid; gap: 8px }
.app-row {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
}
.app-row__link {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  color: var(--ink); min-height: 72px;
}
.app-row:hover { border-color: #d9cfc0 }
.app-row__text { flex: 1; min-width: 0 }
.app-row__name { display: block; font-size: 1rem }
.app-row__sub { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.app-row__rating { font-weight: 800; color: var(--navy) }

.rank-list { display: grid; gap: 8px }
@media (min-width: 800px) { .rank-list { grid-template-columns: 1fr 1fr; gap: 10px 24px } }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; color: var(--ink) }
.rank-item:hover { background: var(--paper) }
.rank-item__n { width: 24px; font-family: var(--serif); font-size: 1.3rem; color: var(--accent) }
.rank-item__body { display: flex; flex-direction: column }
.rank-item__body small { color: var(--muted) }

.article-wrap { padding: 24px 0 64px; max-width: 820px }
.crumbs { margin-bottom: 18px }
.breadcrumbs__list { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .85rem }
.breadcrumbs__link { color: var(--muted) }
.breadcrumbs__current { color: var(--ink) }

.store-hero {
  background: var(--paper); border: 1px solid var(--line); border-radius: 28px;
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 28px;
}
.store-hero__id { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px }
.store-hero__name { font-family: var(--serif); font-weight: 560; letter-spacing: -.03em; line-height: 1.15; margin: 0; font-size: clamp(1.6rem, 4vw, 2.4rem) }
.store-hero__dev { color: var(--muted); margin: 4px 0 8px }
.store-hero__updated { color: var(--muted); font-size: .82rem; margin: 2px 0 8px }
.store-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 8px 0 0 }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)) } }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700 }
.facts dd { margin: 4px 0 0; font-weight: 650 }

.download-box { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 8px 0 }
.download-box__name { font-weight: 700 }
.download-box__size { color: var(--muted); margin-left: 8px }
.download-box__buttons { display: flex; flex-wrap: wrap; gap: 8px }
.download-box__notice { width: 100%; color: var(--muted); font-size: .85rem; display: flex; gap: 6px; align-items: center }

.article__lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 20px }
.article__head { margin-bottom: 20px }
.article__head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem) }
.article__meta { color: var(--muted); margin-top: 8px }
.article__cover { border-radius: 20px; overflow: hidden; margin-bottom: 24px }

.entry-content { font-size: 1.05rem; color: #2c261f }
.entry-content h2, .entry-content h3 { margin: 1.6em 0 .5em }
.entry-content p { max-width: 62ch }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em 1.1em; list-style: disc }
.entry-content ol { list-style: decimal }
.entry-content a { text-decoration: underline; text-underline-offset: 3px }
.entry-content img { border-radius: 16px }

.toc { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; margin: 0 0 24px }
.toc__toggle { display: flex; width: 100%; justify-content: flex-start; gap: 8px; align-items: center; font-weight: 700 }
.toc__arrow { margin-left: auto; transition: transform var(--fast) }
.toc__toggle[aria-expanded="false"] .toc__arrow { transform: rotate(-90deg) }
.toc__list { margin-top: 10px; display: grid; gap: 6px }
.toc__link { color: var(--muted) }
.toc__link.is-active, .toc__link:hover { color: var(--accent-dark) }

.shots { margin: 8px 0 28px }
.shots__title { font-size: 1.2rem; margin-bottom: 12px }
.shots__track { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory }
.shots__item { flex: 0 0 180px; scroll-snap-align: start; border-radius: 16px; overflow: hidden; background: #efe8dc }
.shots__item img { width: 100%; height: 320px; object-fit: cover }

.note { background: #f7efe4; border-radius: 16px; padding: 16px 18px; margin: 28px 0 16px }
.note p { margin: .4em 0 0; color: var(--muted) }
.get-file { margin-bottom: 32px }
.get-file h2 { margin-bottom: 12px }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 }
.tag-row a { padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-size: .85rem }

.listing { padding: 28px 0 64px }
.listing__head { margin-bottom: 22px }
.listing__head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem) }
.listing__desc, .listing__count { color: var(--muted); margin-top: 8px }

.empty { text-align: center; padding: 64px 16px }
.empty__code { font-family: var(--serif); font-size: 4rem; color: var(--accent); margin: 0 }
.empty .search-form { max-width: 420px; margin: 20px auto }

.site-footer { margin-top: 40px; padding: 40px 0 28px; border-top: 1px solid var(--line); color: var(--muted) }
.site-footer__top { display: grid; gap: 28px }
@media (min-width: 800px) { .site-footer__top { grid-template-columns: 1.2fr 1fr } }
.site-footer h3, .site-footer .footer__title { font-family: var(--font); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 0 0 10px }
.site-footer a { color: var(--muted) }
.site-footer a:hover { color: var(--ink) }
.site-footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px }
@media (min-width: 800px) { .site-footer__cols { grid-template-columns: 1fr 1fr 1.2fr } }

.article--legal .article__kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; color: var(--muted); margin: 0 0 8px;
}
.article--legal .entry-content { max-width: 68ch }
.article--legal .entry-content h2 { font-size: 1.35rem }
.legal-contact {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .95rem;
}

/* Compact bottom bar: ~90px tall on a 375px phone (< 20% of a 812px viewport) */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 120;
  max-height: 40vh;
  overflow: hidden;
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(40, 24, 8, .08);
  padding: 10px 14px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.cookie-banner[hidden] { display: none !important }
.cookie-banner__inner {
  display: flex; flex-direction: row; align-items: center; gap: 12px;
  width: min(1120px, 100%);
  margin: 0 auto;
}
.cookie-banner__text { margin: 0; flex: 1; min-width: 0; color: var(--ink); font-size: .8rem; line-height: 1.35 }
.cookie-banner__text a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px }
.cookie-banner__ok { min-height: 36px; width: auto; padding: 6px 14px; font-size: .85rem; flex-shrink: 0; touch-action: manipulation }
body.cookie-banner-on { padding-bottom: 120px }
@media (min-width: 720px) {
  .cookie-banner { left: 50%; right: auto; width: min(720px, calc(100% - 32px)); transform: translateX(-50%); bottom: 16px; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 18px }
  .cookie-banner__inner { gap: 18px }
  .cookie-banner__text { font-size: .85rem }
  .cookie-banner__ok { min-width: 120px; min-height: 40px }
  body.cookie-banner-on { padding-bottom: 0 }
}
.site-footer__brand p { margin-top: 10px; max-width: 36ch }
.brand--footer { color: var(--ink) }
.site-footer__bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 28px; font-size: .85rem }

.comments-area { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line) }
.comments-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: baseline; margin-bottom: 20px }
.comments-title { font-size: 1.6rem }
.comments-summary { display: flex; align-items: center; gap: 8px; color: var(--muted) }
.comment-list { display: grid; gap: 12px; margin: 0 0 28px }
.comment-list .children { list-style: none; margin: 12px 0 0 18px; display: grid; gap: 12px; padding: 0 }
.comment__card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px;
}
.comment--official > .comment__card {
  border-color: #f0c4b0; background: linear-gradient(180deg, #fff6f1 0%, var(--paper) 48%);
}
.comment--pinned > .comment__card { border-color: #e0c48a }
.comment__pin, .comment__official-badge {
  display: inline-flex; margin: 0 8px 10px 0; padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 800; letter-spacing: .02em;
}
.comment__pin { background: #f6e7c2; color: #7a5410 }
.comment__official-badge { background: var(--accent); color: #fff }
.comment__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px }
.comment__avatar-letter {
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  background: hsl(var(--hue) 55% 42%); color: #fff; font-weight: 800;
}
.comment__who { display: flex; flex-direction: column; min-width: 0 }
.comment__author { font-weight: 800 }
.comment__date { color: var(--muted); font-size: .82rem }
.comment__stars { margin-left: auto; color: var(--accent); letter-spacing: 1px }
.comment__text { color: #2c261f }
.comment__text p:last-child { margin-bottom: 0 }
.comment__bar { display: flex; gap: 12px; align-items: center; margin-top: 12px }
.comment__like {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); font-weight: 700; color: var(--ink);
}
.comment__like:hover { border-color: var(--accent) }
.comment__like.is-liked, .comment__like[aria-pressed="true"] { color: var(--accent-dark); border-color: #f0c4b0; background: #fff6f1 }
.comment-reply-link { font-weight: 700; color: var(--muted) }
.comment-awaiting, .comment__awaiting { color: var(--muted); font-size: .9rem }
.comment-form { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 22px }
.comment-reply-title { margin-bottom: 8px }
.comment-notes { color: var(--muted); font-size: .92rem }
.comment-form label { display: block; font-weight: 700; margin-bottom: 6px }
.comment-form .required { color: var(--accent) }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff;
  font: inherit; color: var(--ink);
}
.comment-form textarea { min-height: 120px; resize: vertical }
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px }
.comment-form-author, .comment-form-comment { margin: 0 0 14px }
.comment-rating { margin: 0 0 16px }
.comment-rating__label { font-weight: 700; display: block; margin-bottom: 8px }
.comment-rating__stars { display: inline-flex; flex-direction: row-reverse; gap: 4px }
.comment-rating__input { position: absolute; opacity: 0; pointer-events: none }
.comment-rating__star { cursor: pointer; color: #d9cfc0 }
.comment-rating__star svg { fill: currentColor }
.comment-rating__input:checked ~ .comment-rating__star,
.comment-rating__star:hover,
.comment-rating__star:hover ~ .comment-rating__star { color: var(--accent) }
.comment-rating__hint { display: block; color: var(--muted); font-size: .8rem; margin-top: 6px }
.comment-form-captcha { margin: 8px 0 16px }
.form-submit { margin: 0 }
.store-hero__votes { display: block; color: var(--muted); font-size: .85rem; font-weight: 600; margin-top: 4px }

.pagination { margin-top: 28px }
.pagination ul { display: flex; gap: 6px; flex-wrap: wrap }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); background: var(--paper) }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink) }

.rating { display: inline-flex; align-items: center; gap: 8px }
.rating__stars { width: 90px; height: 16px; background: #e7ddd0; border-radius: 4px; overflow: hidden; position: relative }
.rating__fill { height: 100%; background: var(--accent) }
.rating__value { font-weight: 700; font-size: .9rem }

.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(20,16,12,.86); z-index: 80;
  display: none; align-items: center; justify-content: center;
}
.lightbox-overlay.is-open { display: flex }
.lightbox__img { max-height: 86dvh; max-width: 92vw; border-radius: 12px }
.lightbox__close, .lightbox__prev, .lightbox__next {
  position: absolute; color: #fff; font-size: 2rem; width: 48px; height: 48px;
}
.lightbox__close { top: 16px; right: 16px }
.lightbox__prev { left: 12px }
.lightbox__next { right: 12px }

.back-to-top {
  position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink); color: #fff; opacity: 0; visibility: hidden; z-index: 30;
}
.back-to-top.is-visible { opacity: 1; visibility: visible }

.download-page { padding: 40px 0 72px }
.download-page__card {
  max-width: 560px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line);
  border-radius: 28px; padding: 28px; box-shadow: var(--shadow); text-align: center;
}
.download-page__back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); margin-bottom: 18px }
.download-page__header { display: flex; gap: 14px; text-align: left; margin-bottom: 24px }
.download-page__icon img { width: 72px; height: 72px; border-radius: 20px }
.download-page__title { font-size: 1.6rem }
.download-page__badge { display: inline-block; margin-right: 6px; background: var(--chip); padding: 3px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700 }
.download-page__timer-section { margin: 12px 0 20px }
.download-page__timer-ring { position: relative; width: 120px; margin: 0 auto }
.download-page__timer-text { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 2rem }
.download-page__buttons { display: grid; gap: 10px }
.download-page__safety { margin-top: 16px; color: var(--good); display: flex; gap: 8px; justify-content: center; align-items: center; font-size: .9rem }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px }
.mini-apps { display: grid; gap: 10px }
.mini-apps a { display: flex; gap: 10px; align-items: center; color: var(--ink) }
.mini-apps small { display: block; color: var(--muted) }

.overflow-hidden { overflow: hidden }
.copy-code-btn { position: absolute; top: 8px; right: 8px; font-size: .75rem; padding: 4px 8px; border-radius: 8px; background: var(--chip) }

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

/* Comparison table generated by wp-autoparser-ai («Оригинал vs мод») */
.entry-content table.compare { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .95rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden }
.entry-content table.compare th, .entry-content table.compare td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line) }
.entry-content table.compare thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--sand) }
.entry-content table.compare tbody tr:last-child td { border-bottom: 0 }
.entry-content table.compare td:first-child { font-weight: 600 }
@media (max-width: 600px) { .entry-content table.compare { display: block; overflow-x: auto } }

/* Single post: content + sidebar (sticky on desktop, stacked under the article on mobile) */
.article-wrap--sidebar { max-width: none }
.article-wrap--sidebar .site-main { min-width: 0 }
.sidebar { display: grid; gap: 16px; align-content: start; margin-top: 8px }
.side-panel { padding: 18px }
.side-panel__title { font-family: var(--serif); font-weight: 560; font-size: 1.15rem; letter-spacing: -.02em; margin: 0 0 12px }
.side-list { display: grid; gap: 4px }
.side-list__link { display: flex; gap: 12px; align-items: center; padding: 6px; margin: 0 -6px; border-radius: 12px; color: var(--ink); min-height: 44px }
.side-list__link:hover { background: var(--sand); color: var(--ink) }
.side-list__text { min-width: 0 }
.side-list__name { display: block; font-size: .95rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.side-list__sub { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.side-panel__more { display: inline-block; margin-top: 12px; font-size: .85rem; font-weight: 700; color: var(--accent-dark) }
@media (min-width: 640px) and (max-width: 1023px) {
  .sidebar { grid-template-columns: 1fr 1fr; margin-top: 16px }
}
@media (min-width: 1024px) {
  .article-wrap--sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; max-width: var(--max) }
  .article-wrap--sidebar .site-main { max-width: 820px }
  .sidebar { position: sticky; top: calc(var(--header-h) + 20px); margin-top: 0 }
}

/* Long catalog text: category description body (archive.php) and homepage text (front-page.php).
   Goes after .entry-content so it overrides its font-size / paragraph width. */
.catalog-text { max-width: 760px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 1rem }
.catalog-text h2 { font-size: 1.35rem; margin: 1.4em 0 .5em }
.catalog-text h3 { font-size: 1.1rem; margin: 1.2em 0 .4em }
.catalog-text p { max-width: 70ch }
.catalog-text-wrap { padding: 8px 0 56px }
.catalog-text-wrap .catalog-text { margin-top: 0 }
.listing__desc { max-width: 70ch }

/* Listing load-more (infinite-scroll.js) */
.load-more-sentinel { height: 1px }
.load-more-spinner { width: 28px; height: 28px; margin: 20px auto 0; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: load-more-spin .8s linear infinite }
@keyframes load-more-spin { to { transform: rotate(360deg) } }
.load-more { display: flex; justify-content: center; margin: 20px 0 0 }
.btn--more { background: var(--paper); border: 1px solid var(--line); color: var(--ink); min-width: 200px }
.btn--more:hover { border-color: var(--accent); color: var(--accent-dark) }
