/* DLE 16 integration; original visual system is in core/cards/header/fullstory. */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid hsl(var(--c-primary)); outline-offset: 4px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 1000; padding: 12px 20px; border-radius: 16px; background: hsl(var(--c-body)); }
.skip-link:focus { top: 8px; }
.content-5p, .catalog-content, .app-description, .system-content { min-width: 0; }
.catalog-content #dle-content { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 32px 24px; }
.catalog-content .appitem { --appicon-size: 128px; display: flex; gap: 16px; min-width: 0; }
.catalog-content .card-icon { flex: 0 0 128px; width: 128px; }
.catalog-content .card-icon .appicon { width: 128px; height: 128px; }
.catalog-content .appitem > .cont { flex: 1; padding: 4px 0; min-width: 0; }
.catalog-content .navigation, .catalog-content #dle-content > :not(.appitem) { grid-column: 1 / -1; }
.catalog-content .appitem .title { overflow-wrap: anywhere; }
.page-category .category-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.page-category .category-tags > a { display: inline-flex; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.page-category .category-tags:not(.open) > a:nth-of-type(n+7) { display: none; }
.page-category .category-tags:not(.open) > .category-tags-more { display: inline-flex; }
.category-tags > a[aria-current] { background: hsla(var(--c-primary), .22); }
.page-search .search-content { max-width: 912px; padding-top: 80px; padding-left: var(--wrp-p); padding-right: var(--wrp-p); }
.page-search .header-second, .page-search .header-first .qs-toggle { display: none !important; }
.page-search .content-5p { padding-top: 0; margin-top: 0; }
.page-search .search-content .navigation { margin-top: 32px; }
.search-item { position: relative; }
.search-item .title { overflow-wrap: anywhere; }
.search-item-cat a { color: inherit; }
.search-box-field > input { width: 100%; }
.search-box-field > .btn { box-shadow: none; border: 0; background: transparent; }
.advanced-search { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; text-align: left; }
.advanced-search > div { min-width: 0; }
.advanced-search label { display: block; margin-bottom: 6px; }
.advanced-search select, .advanced-search input:not([type=checkbox]) { width: 100%; max-width: 100%; margin-bottom: 8px; }
.advanced-toggle { font-size: 12px; margin-top: 8px; }
.recommend-strip { padding: 40px 0; background: linear-gradient(hsl(var(--c-body-tone)),hsl(var(--c-body))); }
.useful { padding: 24px; text-align: center; border-radius: var(--block-rd); box-shadow: var(--block-sw); background: hsl(var(--block-bg)); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.useful .appicon { width: 64px; height: 64px; }
.useful .title { font-size: 16px; }
.useful .desc { font-size: 14px; opacity: .7; flex: 1; }
.useful .btn { box-shadow: inset 0 0 0 1px var(--c-border); }
.collection-card { min-height: 280px; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: var(--block-rd); color: white; background: radial-gradient(at 0 0,#19577b,transparent 80%),linear-gradient(145deg,#102c48,#397a8c); }
.collection-card:nth-child(2) { background: linear-gradient(145deg,#20443c,#82ac43); }
.collection-card:nth-child(3) { background: linear-gradient(145deg,#554336,#c26729); }
.collection-card:nth-child(4) { background: linear-gradient(145deg,#1a1643,#704ab8); }
.collection-card > a { color: white; font-size: 18px; }
.collection-apps { display: flex; gap: 8px; margin-top: 12px; }
.collection-apps .appicon { width: 48px; height: 48px; }
.cardposts .desc { margin-top: 8px; font-size: 15px; opacity: .8; }
.app-body { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 72px; margin-top: 40px; margin-bottom: 40px; }
.app-rich-content { margin-top: 24px; }
.app-rich-content.collapsible-rich:not(.expanded-rich) { max-height: 7.5em; overflow: hidden; }
.app-description .description-more { margin-top: 16px; font-size: inherit; color: hsl(var(--c-primary)); }
.app-rich-content[hidden] + .description-more { display: none; }
.app-rich-content > p:empty { display: none; }
.app-rich-content img, .app-rich-content video, .app-rich-content iframe { max-width: 100%; }
.app-rich-content a { overflow-wrap: anywhere; }
.app-description .theme-tabs { width: max-content; max-width: 100%; }
.theme-tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 24px; box-shadow: inset 0 0 0 1px var(--c-border); margin-bottom: 20px; background: hsla(var(--c-text),.03); }
.theme-tabs button { padding: 8px 20px; border-radius: 20px; font-size: 14px; line-height: 20px; }
.theme-tabs .active { background: hsl(var(--block-bg)); box-shadow: var(--block-sw); }
.app-rating { align-self: start; padding-top: 32px; min-width: 0; }
.app-rating .title { font-size: clamp(18px,1.5vw,24px); line-height: 1.4; margin-bottom: 12px; }
.popularity-summary { container-type: inline-size; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-rating .rating-percent { font-size: clamp(64px,24cqi,112px); line-height: 1.15; color: hsl(var(--c-primary)); letter-spacing: -5px; font-variant-numeric: tabular-nums; }
.popularity-badge { display: grid; place-items: center; flex: 0 0 clamp(72px,25cqi,112px); width: clamp(72px,25cqi,112px); height: auto; aspect-ratio: 1; color: hsl(var(--c-primary)); background: hsla(var(--c-primary),.2); clip-path: polygon(50.00% 0.00%,54.61% 3.23%,59.75% 0.96%,63.64% 5.02%,69.13% 3.81%,72.16% 8.55%,77.78% 8.43%,79.82% 13.67%,85.36% 14.64%,86.33% 20.18%,91.57% 22.22%,91.45% 27.84%,96.19% 30.87%,94.98% 36.36%,99.04% 40.25%,96.77% 45.39%,100.00% 50.00%,96.77% 54.61%,99.04% 59.75%,94.98% 63.64%,96.19% 69.13%,91.45% 72.16%,91.57% 77.78%,86.33% 79.82%,85.36% 85.36%,79.82% 86.33%,77.78% 91.57%,72.16% 91.45%,69.13% 96.19%,63.64% 94.98%,59.75% 99.04%,54.61% 96.77%,50.00% 100.00%,45.39% 96.77%,40.25% 99.04%,36.36% 94.98%,30.87% 96.19%,27.84% 91.45%,22.22% 91.57%,20.18% 86.33%,14.64% 85.36%,13.67% 79.82%,8.43% 77.78%,8.55% 72.16%,3.81% 69.13%,5.02% 63.64%,0.96% 59.75%,3.23% 54.61%,0.00% 50.00%,3.23% 45.39%,0.96% 40.25%,5.02% 36.36%,3.81% 30.87%,8.55% 27.84%,8.43% 22.22%,13.67% 20.18%,14.64% 14.64%,20.18% 13.67%,22.22% 8.43%,27.84% 8.55%,30.87% 3.81%,36.36% 5.02%,40.25% 0.96%,45.39% 3.23%); }
.popularity-badge .im { --im-size: clamp(40px,15cqi,64px); --im-color: hsl(var(--c-primary)); }
.popularity-scale { display: flex; justify-content: space-between; align-items: end; gap: 3px; height: 40px; margin: 16px 0 20px; }
.popularity-scale > i { display: block; flex: 0 0 2px; border-radius: 2px; }
.popularity-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: hsla(var(--c-text),.6); }
.popularity-meta a { color: inherit; }
.popularity-meta a:hover { color: hsl(var(--c-primary)); }
.popularity-empty { font-size: 14px; margin-top: 12px; }
.app-rating.is-unrated .popularity-badge, .app-rating.is-unrated .popularity-scale { opacity: .45; }
.appview-likes > .rating, .appview-likes > span { align-self: center; }
.appview-likes:has(.rating) { display: flex; padding: 16px; align-items: center; }
.appview-likes .rating { margin: 0; }
.appview-breadcrumbs.speedbar a + a { display: inline !important; }
.appview-breadcrumbs { line-height: 1.8; overflow-wrap: anywhere; }
.appview-intro-cont > .appicon { overflow: visible; }
.appview-intro-cont > .appicon > img { border-radius: inherit; }
.appview-intro-cont .appicon-label { white-space: nowrap; background-color: hsla(var(--c-body), .85); }
.appview-foot { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.appview-foot > .appview-tools { margin-top: 0; max-width: 100%; }
.appview-foot > .appview-likes { margin-left: 0; grid-auto-columns: minmax(136px, 1fr); }
.appview-likes > a { min-height: 76px; gap: 2px; font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
.appview-likes > a .im { opacity: .75; }
.appview-likes > a:focus-visible { outline: 2px solid hsl(var(--c-primary)); outline-offset: 3px; }
@media (max-width: 991px) {
  .appview-intro-cont > .appicon { margin-bottom: 20px; }
}
@media (max-width: 767px) {
  .appview-foot > .appview-tools, .appview-foot > .appview-likes { width: 100%; }
  .appview-foot > .appview-likes { grid-auto-columns: minmax(0, 1fr); }
  .appview-tools > .btn { width: 100%; }
}
.screenshot-note { padding: 16px; color: hsl(var(--c-text)); opacity: .6; font-size: 14px; }
.screenshots .screenshot-link img { object-fit: cover; width: 100%; height: auto; }
.download-box { padding: 32px; border-radius: var(--block-rd); background: hsla(var(--c-primary), .07); }
.download-box .title { font-size: 22px; }
.download-box .theme-attachment { display: block; margin: 16px 0; }
.download-line-link { display: flex; gap: 16px; justify-content: space-between; padding: 16px; border-radius: 10px; color: #fff; background: hsl(var(--c-primary)); overflow-wrap: anywhere; }
.download-line-link > span { min-width: 0; }
.download-line-link:hover { color: #fff; background: hsl(var(--c-link-h)); }
.app-info { display: grid; grid-template-columns: minmax(120px,1fr) 2fr; gap: 8px 20px; }
.app-info dd { margin: 0; overflow-wrap: anywhere; }
.comments-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 80px; }
.comment-login { align-self: end; }
.comment-login .btn { margin-top: 16px; }
.theme-comment-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.theme-comment-head time { display: block; font-size: 12px; opacity: .6; }
.comment-avatar { border-radius: 50%; object-fit: cover; }
.theme-comment-cloud { padding: 20px; border-radius: 0 24px 24px; background: var(--comcloud-bg-pos); }
.theme-comment-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; margin-top: 12px; opacity: .7; }
.theme-comment-tools > span { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.theme-comment-tools .im { width: 18px; height: 18px; }
.comments-section .comment { margin-bottom: 28px; }
.comments-section .comment .text { font-size: 15px; overflow-wrap: anywhere; }
.comments-section .dle-comments-editor, #comment-editor { max-width: 100%; }
.comments-section .ui-form { padding: 0; list-style: none; }
.comments-section .form-group { margin-bottom: 12px; }
.comments-section .form-submit, .comments-section .form_submit { margin-top: 20px; }
.comments-section .btn { border-radius: 12px; }
.theme-notice { padding: 20px 24px; margin-bottom: 24px; border-radius: 24px; background: hsla(var(--c-yellow),.2); overflow-wrap: anywhere; }
.theme-notice strong { display: block; margin-bottom: 8px; }
.theme-login { max-width: 480px; width: calc(100vw - 32px); }
.theme-login .modal-cont { width: 100%; }
.theme-login .form-group label { display: block; margin-bottom: 6px; }
.login-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; }
.modal-overlay { z-index: 200; }
.modal-overlay .modal-inner { min-height: 100%; display: flex; align-items: center; justify-content: center; }
.modal-overlay .modal { position: relative; max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal-open, .mo { overflow: hidden; }
.mobile-menu-overlay { position: fixed; inset: 0; z-index: 149; background: rgba(0,0,0,.3); }
.mobilemenu { z-index: 150; }
.mobilemenu .close-btn { display: block !important; }
.scroll-button:disabled { opacity: .25; cursor: default; }
.theme-expanded .expand-text { max-height: none !important; -webkit-line-clamp: unset !important; overflow: visible !important; }
.theme-expanded .expand-text::after { display: none; }
.system-content { padding-top: 32px; padding-bottom: 40px; }
.system-content .box { padding: 24px; margin: 24px 0; border: 1px solid var(--c-border); border-radius: 24px; }
.system-content .box_in { padding: 0; }
.system-content .ui-form { list-style: none; padding-left: 0; }
.system-content .ui-form > li, .system-content .form-group { margin-bottom: 16px; }
.system-content label { display: block; margin-bottom: 6px; }
.system-content .icon { width: 24px; height: 24px; }
.f-telegram { gap: 16px; flex-wrap: wrap; }
.f-telegram > .btn { margin-left: auto; }
.fmenu-list:empty { display: none; }
.im-thumb-up { --im-img: url(../img/icons/thumb-up.svg); }
.im-thumb-down { --im-img: url(../img/icons/thumb-down.svg); }
@media (max-width:1399px) {
  .catalog-content .appitem { --appicon-size: 96px; gap: 12px; }
  .catalog-content .card-icon { flex-basis: 96px; width: 96px; }
  .catalog-content .card-icon .appicon { width: 96px; height: 96px; }
}
@media (min-width:992px) and (max-width:1199px) {
  .catalog-content #dle-content { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width:991px) {
  .catalog-content #dle-content { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 20px; }
  .app-body { gap: 32px; grid-template-columns: minmax(0,1fr); }
  .app-rating { padding: 0; }
  .app-rating { max-width: 520px; width: 100%; }
  .comments-layout { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .comment-login { order: -1; }
  .page-search .search-content { padding-top: 40px; }
}
@media (max-width:575px) {
  .catalog-content #dle-content { gap: 24px 16px; }
  .catalog-content .appitem { display: block; }
  .catalog-content .card-icon, .catalog-content .card-icon .appicon { width: 100%; height: auto; aspect-ratio: 1; }
  .catalog-content .appitem .cont { margin-top: 12px; }
  .catalog-content .meta { font-size: 11px; }
  .download-box { padding: 20px; }
  .download-line-link { flex-direction: column; gap: 8px; }
  .theme-tabs button { padding: 8px 16px; }
  .app-info { grid-template-columns: 1fr; gap: 4px; }
  .app-info dd { margin-bottom: 12px; }
  .advanced-search { grid-template-columns: 1fr; }
  .search-item .title { font-size: 14px; }
  .f-telegram > .btn { margin-left: 0; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.appicon { aspect-ratio: 1; border-radius: 24%; overflow: hidden; }
.appicon > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-wallpaper > .appicon { overflow: visible; }
.card-wallpaper > .appicon > img { border-radius: 24%; }
.catalog-content .appitem { min-width: 0; }
.catalog-content .appitem .title { order: 0; }
.catalog-content .appitem .cont { display: flex; flex-direction: column; gap: 4px; }
.category-description:not(:has(.text:empty)) { margin-top: 48px; }
.category-description .text:not(:empty) { padding: 32px; border: 1px solid var(--c-border); border-radius: var(--block-rd); font-size: 15px; opacity: .8; }
.category-head-menu .scroll-container { margin-bottom: 32px; }
.page-category .sect:has(.rateapps) { margin-bottom: 32px; }
.card-wallpaper .appicon { width: 80px; height: 80px; }
.best-games-carousel .scroll-button.hidden { opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
@media (min-width:992px) {
  .best-games-carousel .hcarousel {
    --card-wmin: calc((100% - var(--g-gap) * 3) / 4);
    grid-auto-columns: var(--card-wmin);
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .best-games-carousel .hcarousel .card {
    scroll-margin-left: 0;
    scroll-margin-right: 0;
    scroll-snap-stop: normal;
  }
}
@media (min-width:992px) {
  .hmenu-list > #mmenu-btn.m-item { display: flex !important; }
  html:not(.mo) .mobilemenu { display: none !important; }
  html.mo .mobilemenu { display: block !important; position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 360px; max-height: calc(100dvh - 40px); overflow-y: auto; background: hsl(var(--modal-bg)); border-radius: 28px; box-shadow: var(--modal-sw); }
  .mobilemenu-cont { padding: 48px 24px 24px; }
  .mmenu-list .m-item { display: flex; padding: 12px; }
  .mmenu-sublist { padding: 16px 12px; border-top: 1px solid var(--c-border); }
}

/* Native DLE gallery: mixed orientations share a height and keep their proportions. */
.app-gallery { --shot-height: min(280px,48vw); }
.app-gallery .hcarousel.glist { display: flex; gap: 20px; align-items: start; overflow-x: auto; padding: 0; margin: 0; border-radius: 0; scroll-snap-type: x proximity; }
.app-gallery .glist > .screenshot-link { flex: 0 0 auto; width: calc(var(--shot-height) * var(--shot-ratio,1.77778)); max-width: calc(100vw - 2 * var(--wrp-p)); height: var(--shot-height); aspect-ratio: auto; scroll-snap-align: start; scroll-snap-stop: normal; border-radius: 20px; }
.app-gallery .glist > .screenshot-link img { position: static; display: block; width: 100%; min-width: 0; height: 100%; transform: none; object-fit: contain; }
.app-gallery-viewer { border: 0; padding: 60px 64px 24px; width: min(1400px,96vw); max-width: 96vw; height: min(900px,94dvh); max-height: 94dvh; background: #151817; color: #fff; border-radius: 20px; overflow: hidden; }
.app-gallery-viewer::backdrop { background: rgba(0,0,0,.88); }
.app-gallery-viewer .gallery-toolbar { position: absolute; top: 12px; left: 24px; right: 12px; display: flex; align-items: center; justify-content: space-between; }
.app-gallery-viewer button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); font-size: 36px; line-height: 1; }
.app-gallery-viewer button:hover { background: rgba(255,255,255,.25); }
.app-gallery-viewer .gallery-prev, .app-gallery-viewer .gallery-next { position: absolute; top: calc(50% - 22px); }
.app-gallery-viewer .gallery-prev { left: 8px; }
.app-gallery-viewer .gallery-next { right: 8px; }
.app-gallery-viewer .gallery-full-image { display: block; width: 100%; height: 100%; max-height: 100%; object-fit: contain; touch-action: pan-y pinch-zoom; }
html.gallery-open { overflow: hidden; }
@media (max-width:767px) {
  .app-gallery .hcarousel.glist { gap: 12px; padding-inline: var(--wrp-p); }
  .app-gallery-viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 64px 44px 24px; }
  .app-gallery-viewer button { width: 40px; height: 40px; }
  .app-gallery-viewer .gallery-prev { left: 2px; }
  .app-gallery-viewer .gallery-next { right: 2px; }
}
