/*
Theme Name:   APK Depot
Description:  An Android app download directory theme: date-grouped upload feed, app pages, version history, per-architecture variants and verified download pages. Colours, ads, follow links and pop-up are set in Customize → Theme Settings. Requires the APK Depot Core plugin.
Version:      1.2.0
Requires at least: 6.0
Requires PHP: 7.4
Author:       APK Depot
License:      GPL-2.0-or-later
Text Domain:  apk-depot
Tags:         two-columns, right-sidebar, custom-logo, custom-menu, custom-colors
*/

/* ---------------------------------------------------------------------------
   Tokens (accent comes from Theme Settings, injected as --accent)
--------------------------------------------------------------------------- */
:root {
	--accent: #ff8b14;
	--accent-dark: #d97611;
	--accent-light: #fff1e3;
	--accent-promo: #f26b1d;
	--bg: #eeeeee;
	--card: #ffffff;
	--slide: #f7f9f9;
	--text: #333333;
	--title: #000000;
	--secondary: #747474;
	--muted: #888888;
	--heading: #536d79;
	--divider: #eeeeee;
	--ad-label: #a7b5cc;
	--footer-bg: #d0d1d1;
	--footer-text: #777777;
	--beta: #b45309;
	--beta-soft: #fdf0dc;
	--alpha: #b42318;
	--alpha-soft: #fde7e5;
	--radius: 2px;
	--font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/20px var(--font); overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { line-height: 1.3; margin: 0; font-weight: 500; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 500; }
.break { word-break: break-all; }
.align-right { text-align: right; }
.ico { flex: none; vertical-align: -0.15em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 1170px; margin: 0 auto; padding: 0 15px; }

/* ---------------------------------------------------------------------------
   Header — brand row (72px) + nav/search row (66px)
--------------------------------------------------------------------------- */
.site-header { background: var(--accent); color: #fff; }
.header-brand { display: flex; align-items: flex-start; padding: 20px 0 0 15px; height: 92px; }
.header-brand .header-logo { margin-top: 20px; }
.header-brand .header-title { margin-top: 15px; }
.header-logo { display: flex; align-items: center; justify-content: center; width: 100px; height: 52px; flex: none; color: #fff; }
.header-logo__img { max-width: 100px; max-height: 52px; width: auto; height: auto; }
.header-logo__mark { display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid rgba(255, 255, 255, .9); border-radius: 12px; }
.header-title { padding-left: 23px; min-width: 0; }
.site-title { display: block; color: #fff; font-size: 32px; line-height: 38px; font-weight: 400; }
.site-title:hover { color: #fff; text-decoration: none; }
.site-tagline { margin: 0; font-size: 16px; line-height: 20px; color: #fff; }

.header-bar { display: flex; align-items: center; justify-content: space-between; height: 66px; margin-top: 24px; padding-right: 15px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; color: rgba(255, 255, 255, .84); }
.site-nav a { display: block; padding: 20px 15px; line-height: 20px; font-size: 18px; color: #fff; }
.site-nav a:hover, .site-nav .current-menu-item > a { background: rgba(0, 0, 0, .08); text-decoration: none; color: #fff; }

.header-tools { display: flex; align-items: center; }
.header-search { position: relative; width: 270px; padding: 5px 0; }
.header-search input { width: 100%; height: 40px; border: 0; border-radius: 0; background: rgba(255, 255, 255, .2); color: #fff; padding: 5px 38px 5px 50px; font: 400 18px var(--font); outline: none; }
.header-search input::placeholder { color: rgba(255, 255, 255, .84); }
.header-search input:focus { background: rgba(255, 255, 255, .28); }
.header-search input::-webkit-search-cancel-button { filter: invert(1); }
.header-search__icon, .header-search__filter { position: absolute; top: 9px; width: 32px; height: 32px; display: grid; place-items: center; color: #fff; }
.header-search__icon { left: 8px; pointer-events: none; }
.header-search__filter { right: 3px; }
.header-search__filter:hover { color: #fff; opacity: .8; }
.header-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-left: 8px; color: #fff; }
.header-icon:hover { color: #fff; opacity: .8; }
.nav-toggle { display: none; margin-left: auto; background: transparent; border: 0; color: #fff; padding: 6px; cursor: pointer; }

@media (max-width: 991px) {
	.header-brand { padding: 10px 0; min-height: 0; }
	.header-logo { width: auto; height: 40px; }
	.header-logo__mark { width: 40px; height: 40px; border-radius: 10px; }
	.header-logo__mark svg { width: 26px; height: 26px; }
	.header-title { padding-left: 12px; }
	.site-title { font-size: 22px; line-height: 28px; }
	.site-tagline { font-size: 13px; line-height: 16px; }
	.nav-toggle { display: block; }
	.header-bar { flex-direction: column; align-items: stretch; margin-top: 0; padding-bottom: 10px; min-height: 0; }
	.site-nav { display: none; order: 2; }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; }
	.site-nav a { padding: 12px 4px; font-size: 16px; }
	.header-tools { order: 1; }
	.header-search { flex: 1; width: auto; }
}

/* ---------------------------------------------------------------------------
   Layout — 2/3 main + 1/3 sidebar, stacked below 992px
--------------------------------------------------------------------------- */
.site-content { margin: 15px 0 25px; }
.layout { display: flex; align-items: flex-start; }
.main { width: 66.666%; padding: 0 16px; min-width: 0; }      /* 760px column → 728px cards */
.sidebar { width: 33.333%; padding: 0 15px; min-width: 0; }    /* 380px column → 350px cards */
@media (max-width: 991px) {
	.layout { display: block; }
	.main, .sidebar { width: auto; padding: 0; }
}

.page-title { font-size: 22px; font-weight: 500; color: var(--title); margin-bottom: 4px; }
.breadcrumbs ol { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; }
.breadcrumbs a { color: var(--secondary); }

/* ---------------------------------------------------------------------------
   Cards
--------------------------------------------------------------------------- */
.box { background: var(--card); border-radius: var(--radius); margin-bottom: 15px; padding: 15px 16px; }
.box__title { font-size: 16px; font-weight: 500; color: var(--heading); margin: 0 0 10px; line-height: 19px; }
.box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.box__head--wrap { flex-wrap: wrap; }
.box__head .box__title { margin: 0; }
.box__more { font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* List cards: rows run edge to edge, heading inset 16px. */
.box--list { padding: 15px 0 0; overflow: hidden; }
.box--list > .box__title { margin: 0 0 10px 16px; }
.box--list > .box__head { margin: 0 16px 10px; }
.box--list > .empty, .box--list > .hint, .box--list > .term-desc { margin-left: 16px; margin-right: 16px; }
.box--list > .table-wrap { border-top: 1px solid var(--divider); }
.box--list > :last-child:not(.release-list):not(.side-list):not(.table-wrap):not(.pagination) { margin-bottom: 15px; }
.box--list > .app-grid { padding: 0 8px 12px; }

.empty { color: var(--muted); padding: 6px 0 15px; margin: 0; }
.hint { font-size: 13px; color: var(--secondary); background: var(--slide); padding: 10px 12px; margin: 10px 0; }

/* ---------------------------------------------------------------------------
   Upload rows (59px) + info slide
--------------------------------------------------------------------------- */
.release-list { border-top: 0; }
.appRow { display: table; table-layout: fixed; width: 100%; min-height: 59px; padding: 5px 16px; border-bottom: 1px solid var(--divider); }
.appRow > div { display: table-cell; vertical-align: middle; }
.appRow__icon { width: 56px; height: 48px; line-height: 0; }
.appRow__icon .apkd-icon { border-radius: 0; }
.appRow__text { word-wrap: break-word; }
.appRow__title { font-size: 14px; font-weight: 400; line-height: 17px; color: var(--title); }
.appRow__title > a { color: var(--title); }
.appRow__title > a:hover { color: var(--accent); }
.appRow__by { color: var(--secondary); }
.appRow .badge, .sideRow .badge { background: var(--bg); color: var(--secondary); }  /* neutral channel badge in lists */
.appRow__by a { color: var(--secondary); }
.appRow__by a:hover { color: var(--accent); }
.appRow__variants { display: inline-flex; align-items: center; gap: 4px; height: 20px; font-size: 14px; line-height: 17px; color: var(--accent); }
.appRow__info { width: 30px; text-align: right; }
.info-toggle { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: #757575; cursor: pointer; border-radius: 50%; }
.info-toggle:hover, .info-toggle[aria-expanded="true"] { color: var(--accent); }
.appRow__slide { background: var(--slide); border-bottom: 1px solid var(--divider); padding: 10px 0; }
.info-table { margin: 0 16px; }
.info-table > div { display: flex; gap: 10px; padding: 3px 0; }
.info-table dt { width: 100px; flex: none; color: var(--muted); }
.info-table dd { margin: 0; color: var(--text); }

/* ---------------------------------------------------------------------------
   Sidebar rows
--------------------------------------------------------------------------- */
.side-list { border-top: 0; }
.sideRow { display: flex; align-items: center; min-height: 59px; padding: 5px 16px; border-bottom: 1px solid var(--divider); color: var(--title); }
.sideRow:hover { text-decoration: none; background: var(--slide); color: var(--title); }
.sideRow:hover .sideRow__name { color: var(--accent); }
.sideRow__icon { width: 56px; flex: none; line-height: 0; }
.sideRow__icon .apkd-icon { border-radius: 0; }
.sideRow__name { flex: 1; min-width: 0; font-size: 14px; line-height: 17px; }
.sideRow__count { color: var(--muted); padding-left: 10px; white-space: nowrap; }
.side-more { text-align: center; margin: 0; padding: 14px 16px 16px; }
.dir-letter { font-size: 13px; font-weight: 500; color: var(--heading); background: var(--slide); padding: 6px 16px; border-top: 1px solid var(--divider); }

.follow-card .social-icons { list-style: none; display: flex; justify-content: space-around; margin: 0; padding: 0 16px; }
.social { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; }
.social .ico { width: 18px; height: 18px; }
.social:hover { color: #fff; opacity: .85; text-decoration: none; }
.social--x { background: #000; }
.social--mastodon { background: #6364ff; }
.social--telegram { background: #229ed9; }
.social--rss { background: #f26522; }
.follow-card__btn { text-align: center; margin: 12px 16px 15px !important; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border: 1px solid #dddddd; border-radius: 4px; background: #eeeeee; color: var(--text); font-size: 12px; }
.pill-btn:hover { background: #e4e4e4; color: var(--title); text-decoration: none; }
.pill-btn .ico { width: 14px; height: 14px; }

/* ---------------------------------------------------------------------------
   Ads
--------------------------------------------------------------------------- */
.ad-slot { text-align: center; padding: 20px 0; }
.ad-slot--top { margin-top: -12px; padding: 6px 0 0; }
.ad-slot--top .ad-body { margin-bottom: 6px; }
.ad-slot--inlist { border-bottom: 1px solid var(--divider); padding: 20px 16px; }
.ad-slot--sidebar { padding: 20px 0; margin-bottom: 15px; }
.ad-label { font-size: 12px; font-weight: 500; color: var(--ad-label); line-height: 17px; }
.ad-body { display: flex; justify-content: center; margin: 2px auto 6px; overflow: hidden; }
.ad-placeholder { background: repeating-linear-gradient(45deg, #e2e4e6, #e2e4e6 10px, #e8eaec 10px, #e8eaec 20px); color: #9aa3ab; align-items: center; font-size: 13px; }
.ad-slot--billboard .ad-placeholder { width: 970px; max-width: 100%; height: 250px; }
.ad-slot--inlist .ad-placeholder { width: 336px; max-width: 100%; height: 280px; }
.ad-slot--sidebar .ad-placeholder { width: 300px; max-width: 100%; height: 250px; }
@media (max-width: 767px) { .ad-slot--billboard .ad-placeholder { height: 100px; } }

/* ---------------------------------------------------------------------------
   Pagination
--------------------------------------------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; margin: 7px 0; padding: 18px 16px; min-height: 89px; text-align: center; }
.box > .pagination { margin: 0; }
.main > .pagination { background: var(--card); border-radius: var(--radius); margin: 0 0 15px; }
.pagination .pages { flex-basis: 100%; margin-bottom: 6px; color: var(--text); }
.pagination .page-link { padding: 3px 5px; border-radius: var(--radius); color: var(--title); }
.pagination a.page-link:hover { background: var(--bg); text-decoration: none; }
.pagination .current { font-weight: 700; color: var(--text); }
.pagination .dots { color: var(--muted); padding: 0 2px; }

/* ---------------------------------------------------------------------------
   Badges, chips, buttons
--------------------------------------------------------------------------- */
.apkd-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; object-fit: cover; color: #fff; font-weight: 500; border-radius: 18%; }
.badge { display: inline-block; font-size: 10px; font-weight: 500; line-height: 1; padding: 3px 6px; border-radius: var(--radius); vertical-align: 1px; text-transform: uppercase; letter-spacing: .03em; }
.badge--beta { background: var(--beta-soft); color: var(--beta); }
.badge--alpha { background: var(--alpha-soft); color: var(--alpha); }
.badge--stable { background: var(--accent-light); color: var(--accent); }
.badge--type { background: var(--bg); color: var(--text); text-transform: none; letter-spacing: 0; font-size: 12px; }
.badge--bundle, .badge--xapk { background: var(--accent-light); color: var(--accent-dark); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--bg); color: var(--text); font-size: 13px; }
.chip:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.chip--sm { padding: 1px 10px; font-size: 12px; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius); border: 1px solid #d5d8da; background: var(--card); color: var(--text); font: 500 14px var(--font); cursor: pointer; text-align: left; }
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn small { display: block; font-weight: 400; font-size: 12px; opacity: .9; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn--ghost { background: transparent; }
.btn--sm { padding: 5px 12px; font-size: 13px; }
.btn--lg { padding: 10px 20px; font-size: 16px; }
.btn--xl { padding: 13px 28px; font-size: 18px; width: 100%; max-width: 360px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; color: var(--accent); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--accent-light); }
.icon-btn--sm { width: 28px; height: 28px; }
.icon-btn.is-copied { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------------------
   App grid
--------------------------------------------------------------------------- */
.app-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; }
.app-card__link { display: flex; align-items: center; gap: 12px; padding: 8px; color: var(--title); height: 100%; }
.app-card__link:hover { background: var(--slide); text-decoration: none; color: var(--title); }
.app-card__body { display: flex; flex-direction: column; min-width: 0; }
.app-card__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card__dev { color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card__ver { color: var(--accent); }

.sort-links { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; }
.sort-links a { padding: 3px 10px; border-radius: var(--radius); color: var(--secondary); }
.sort-links a:hover { text-decoration: none; background: var(--bg); }
.sort-links a.is-active { background: var(--accent); color: #fff; }
.term-desc { margin-bottom: 12px; color: var(--secondary); }

/* ---------------------------------------------------------------------------
   App / release header
--------------------------------------------------------------------------- */
.app-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px 16px; }
.app-header__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.app-header__title { font-size: 24px; font-weight: 400; color: var(--title); line-height: 1.25; }
.app-header--release .app-header__title { font-size: 21px; }
.app-header__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.dev-link { color: var(--secondary); }
.app-header__meta .dev-link { font-size: 15px; color: var(--accent); }
.app-header__pkg { color: var(--muted); font-size: 12px; }
.app-header__cta { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 640px) {
	.app-header { grid-template-columns: auto minmax(0, 1fr); }
	.app-header__cta { grid-column: 1 / -1; }
	.app-header__title { font-size: 20px; }
	.app-header .apkd-icon { width: 64px !important; height: 64px !important; }
}
.stats { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 6px 0 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font-weight: 500; }
.dev-header { display: flex; gap: 16px; align-items: flex-start; }
.dev-header__avatar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-light); color: var(--accent); flex: none; }
.dev-header__name { font-size: 22px; font-weight: 400; color: var(--title); }

/* ---------------------------------------------------------------------------
   Tables, spec lists, download card
--------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 16px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.data-table td { padding: 10px 16px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--slide); }
.data-table td:first-child { white-space: nowrap; }
.data-table td .badge + .muted { margin-left: 6px; }
@media (max-width: 640px) { .data-table th, .data-table td { padding: 8px 10px; } .hide-sm { display: none; } }

.spec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; margin: 0; }
.spec-list dt { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.spec-list dd { margin: 2px 0 0; }
.spec-list__wide { grid-column: 1 / -1; }
.hash { display: flex; align-items: center; gap: 8px; }
.hash code { background: var(--slide); padding: 6px 8px; font-size: 12px; flex: 1; }
.download-card { display: flex; flex-direction: column; gap: 18px; padding: 20px 16px; }
.download-card__head { display: flex; gap: 16px; align-items: center; }
.download-card__head p { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 0; }
.download-card__title { font-size: 21px; font-weight: 400; color: var(--title); }
.download-card__status { margin: -8px 0 0; min-height: 1.4em; }
.download-card .spec-list { border-top: 1px solid var(--divider); padding-top: 18px; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; }

/* ---------------------------------------------------------------------------
   Screenshots + lightbox
--------------------------------------------------------------------------- */
.screens { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.screens a { flex: none; scroll-snap-align: start; }
.screens img { height: 320px; width: auto; display: block; }
@media (max-width: 640px) { .screens img { height: 240px; } }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .88); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-height: 92vh; max-width: 100%; width: auto; }

/* ---------------------------------------------------------------------------
   Content, forms, comments
--------------------------------------------------------------------------- */
.entry-content > :first-child { margin-top: 0; }
.entry-content > :last-child { margin-bottom: 0; }
.entry-content h3 { font-size: 15px; margin: 1.2em 0 .4em; }
.entry-content ul, .entry-content ol { padding-left: 20px; }
.post-card__title { font-size: 18px; font-weight: 400; }
.post-thumb { margin: 14px 0; }
.term-list { list-style: none; margin: 0; padding: 0; }
.term-list a { display: flex; justify-content: space-between; padding: 6px 0; color: var(--title); }
.count { color: var(--muted); }

.search-form { display: flex; gap: 8px; }
.search-form__input, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	flex: 1; min-width: 0; width: 100%; padding: 8px 10px; font: inherit; color: var(--text); background: #fff; border: 1px solid #d5d8da; border-radius: var(--radius);
}
.not-found { text-align: center; padding: 40px 20px; }
.not-found .search-form { max-width: 420px; margin: 16px auto 0; }
.comment-list { list-style: none; padding: 0; margin: 0 0 16px; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 12px 0; border-bottom: 1px solid var(--divider); }
.comment-author { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: 12px; }
.comment-metadata a { color: var(--muted); }

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.site-footer { background: var(--footer-bg); box-shadow: 0 0 7px var(--footer-text); color: var(--footer-text); text-align: center; padding: 15px 0; min-height: 70px; }
.site-footer p { margin: 0; line-height: 20px; }
.site-footer a { color: var(--title); }
.site-footer .sep { margin: 0 3px; }

/* ---------------------------------------------------------------------------
   Promo pop-up (bottom-right)
--------------------------------------------------------------------------- */
.promo-popup { position: fixed; right: 15px; bottom: 15px; z-index: 90; width: 205px; padding: 22px 18px 18px; border-radius: 20px; background: var(--accent-promo); color: #fff; text-align: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
.promo-popup[hidden] { display: none; }
.promo-popup p { margin: 0 0 8px; font-size: 15px; line-height: 20px; font-weight: 500; }
.promo-popup a { color: #fff; text-decoration: underline; }
.promo-popup__close { position: absolute; top: 6px; right: 10px; background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }

/* ===========================================================================
   Inner pages (inner-pages-design-spec.md)
=========================================================================== */
:root {
	--app-accent: var(--accent);
	--date: rgba(0, 0, 0, .5);
}

/* Breadcrumb in the header nav row (category / developer pages) */
.header-crumbs { display: flex; align-items: center; gap: 8px; padding: 19px 0 18px; font-size: 18px; line-height: 22px; color: rgba(255, 255, 255, .84); }
.header-crumbs a { color: #fff; }
.header-crumbs .ico { color: rgba(255, 255, 255, .84); }

/* Compact 60px bar (app page) */
.site-header--compact .compact-bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.compact-brand { display: flex; align-items: center; padding: 0 15px; color: #fff; font-size: 18px; line-height: 26px; }
.compact-brand:hover { color: #fff; text-decoration: none; }
.compact-brand__logo { display: flex; align-items: center; justify-content: center; width: 50px; height: 26px; margin-right: 10px; }
.compact-brand__logo .header-logo__img { max-height: 26px; max-width: 50px; }
.compact-brand__logo .header-logo__mark { width: 26px; height: 26px; border-width: 1.5px; border-radius: 6px; }
.compact-brand__logo .header-logo__mark svg { width: 18px; height: 18px; }
.site-header--compact .header-tools { padding-right: 15px; }
.site-header--compact .header-search { width: 310px; }

/* White title band (app page) */
.title-band { background: #fff; }
.title-band__bar { display: flex; align-items: flex-start; margin: 20px 15px 24px; min-height: 96px; }
.title-band__icon { border-radius: 0 !important; margin-right: 9px; }
.title-band__text { padding-top: 8px; min-width: 0; }
.title-band__name { font-size: 36px; font-weight: 300; line-height: 43px; color: #000; padding-bottom: 8px; }
.title-band__dev { font-size: 24px; font-weight: 300; line-height: 29px; color: #000; }
.title-band__dev a { color: #000; }
.band-crumbs { display: flex; align-items: center; gap: 10px; padding: 19px 16px 18px; font-size: 18px; line-height: 22px; border-top: 1px solid var(--divider); }
.band-crumbs a { color: var(--app-accent); }
.band-crumbs .ico { color: #9e9e9e; }
.header-app .site-content { margin-top: 15px; }

/* Ad blocks inside the main column (card width, both captions) */
.ad-slot--card { padding: 20px 0; margin-bottom: 15px; }
.ad-slot--card .ad-placeholder { width: 336px; max-width: 100%; height: 280px; }
.ad-slot--sidebar .ad-label:last-child { margin-top: 0; }

/* Sticky tab bar */
.tab-bar { position: sticky; top: 0; z-index: 20; display: flex; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--divider); border-radius: var(--radius) var(--radius) 0 0; height: 44px; }
.admin-bar .tab-bar { top: 32px; }
.tab-bar__tab { flex: none; padding: 14px 15px 10px; font-size: 12px; font-weight: 500; line-height: 17px; text-transform: uppercase; color: var(--app-accent); border-bottom: 3px solid transparent; }
.tab-bar__tab:hover { text-decoration: none; color: var(--app-accent); background: var(--slide); }
.tab-bar__tab.is-active { border-bottom-color: var(--app-accent); }

/* Panes: stacked white blocks with 5px gaps */
.pane { background: #fff; padding: 0 21px 15px; margin-bottom: 5px; scroll-margin-top: 50px; }
.pane__title { font-size: 17px; font-weight: 500; line-height: 20.4px; color: #333; padding: 5px 0; margin: 10px 0; }
.pane .entry-content p { margin: 0 0 10px; }
.pane .entry-content a { text-decoration: underline; }
.pane__clip { position: relative; }
.pane__clip.is-clipped { max-height: 1000px; overflow: hidden; }
.pane__clip.is-clipped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.show-more { text-align: center; padding: 10px 0; }
.show-more__btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px; font: 400 17px var(--font); color: var(--app-accent); background: #fff; border: 1px solid var(--app-accent); border-radius: var(--radius); cursor: pointer; }
.show-more__btn:hover { background: var(--accent-light); }
#versions { scroll-margin-top: 50px; }

/* Tools row */
.tools-pane { padding-left: 0; padding-right: 0; }
.tools-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.tools-row__cat { padding-left: 16px; font-size: 14px; font-weight: 500; text-transform: uppercase; color: var(--app-accent); }
.tools-row__icons { display: flex; }
.tool-btn { display: grid; place-items: center; width: 24px; height: 24px; margin-right: 16px; padding: 0; border: 0; background: none; color: var(--app-accent); cursor: pointer; }
.tool-btn:hover { color: var(--accent-dark); }
.tool-btn.is-done { color: #2e9e4f; }
.whatsnew { padding: 0 16px; }
.whatsnew > :first-child { margin-top: 0; }
.whatsnew > :last-child { margin-bottom: 0; }
.whatsnew ul { padding-left: 18px; margin: 0; }
.qr-pop { margin: 0 16px 12px auto; width: max-content; padding: 10px; background: #fff; border: 1px solid var(--divider); text-align: center; font-size: 12px; color: var(--muted); }
.qr-pop svg { display: block; width: 160px; height: 160px; margin: 0 auto 6px; }

/* Screenshots carousel + trailer */
.pane .screens { gap: 0; padding-bottom: 0; }
.pane .screens img { height: 243px; border: 0; border-radius: 0; }
.video-16x9 { position: relative; padding-top: 56.25%; background: #000; }
.video-16x9 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Optional row cells: right-aligned date */
.appRow__date { width: 206px; text-align: right; color: var(--date); padding-left: 10px; white-space: nowrap; }
@media (max-width: 640px) { .appRow__date { width: auto; font-size: 12px; white-space: normal; } }

/* A–Z filter */
.az-filter { display: flex; flex-wrap: wrap; justify-content: center; padding: 6px 16px 15px; }
.az { padding: 3px 5px; margin: 2px; font-size: 14px; color: #000; }
.az:hover { text-decoration: none; background: var(--bg); }
.az.is-current { font-weight: 700; color: #333; }
.az.is-empty { color: #bbb; }

@media (max-width: 991px) {
	.site-header--compact .compact-bar { height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
	.site-header--compact .header-tools { flex-basis: 100%; padding: 6px 0 0; }
	.site-header--compact .header-search { flex: 1; width: auto; }
	.compact-brand { padding: 0; }
	.title-band__bar { margin: 16px 0; }
	.title-band__icon { width: 64px !important; height: 64px !important; }
	.title-band__name { font-size: 26px; line-height: 32px; padding-bottom: 4px; }
	.title-band__dev { font-size: 18px; line-height: 22px; }
	.band-crumbs { padding: 12px 0; font-size: 15px; }
	.header-crumbs { padding: 10px 0; font-size: 16px; }
}

/* ===========================================================================
   Functionality (inner-pages spec sections 4-5)
=========================================================================== */

/* Popovers (QR, share, subscribe, filter, account): white, 2px radius, soft shadow */
.popover { position: absolute; z-index: 60; min-width: 200px; padding: 10px 0; background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); font-size: 14px; line-height: 20px; text-align: left; }
.popover[hidden] { display: none; }
.popover a, .popover__link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 16px; color: var(--title); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.popover a:hover, .popover__link:hover { background: var(--slide); text-decoration: none; color: var(--title); }
.popover__head { padding: 4px 16px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--divider); font-weight: 500; }
.popover__text { margin: 0 0 8px; padding: 0 16px; color: var(--secondary); }
.popover__setting { padding: 6px 16px; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); margin: 4px 0; }
.popover__setting small { display: block; color: var(--muted); }
.popover__row { display: flex; flex-direction: column; gap: 4px; padding: 6px 16px; }
.popover fieldset { border: 0; margin: 0; padding: 4px 16px 8px; }
.popover legend { padding: 0; font-weight: 500; margin-bottom: 4px; }
.popover fieldset label { display: block; padding: 2px 0; }
.popover select, .popover input[type="email"] { width: 100%; padding: 6px 8px; font: inherit; border: 1px solid #d5d8da; border-radius: var(--radius); background: #fff; color: var(--text); }
.popover .btn { margin: 6px 16px 0; }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.switch.is-locked { opacity: .6; cursor: not-allowed; }
.badge--premium { background: var(--accent); color: #fff; }

/* Header popovers */
.header-search__filter { border: 0; background: none; cursor: pointer; padding: 0; }
.popover--filter { top: 50px; right: 0; width: 270px; padding-bottom: 14px; }
.popover--filter .btn { margin-left: 16px; }
.account-menu { position: relative; }
.account-menu .header-icon { border: 0; background: none; cursor: pointer; padding: 0; }
.popover--account { top: 44px; right: 0; width: 220px; }

/* Live search suggestions */
.suggest { position: absolute; z-index: 61; top: 50px; left: 0; right: 0; background: #fff; border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); overflow: hidden; }
.suggest[hidden] { display: none; }
.suggest__item { display: flex; align-items: center; gap: 10px; padding: 6px 12px; color: var(--title); }
.suggest__item:hover, .suggest__item.is-active { background: var(--slide); text-decoration: none; color: var(--title); }
.suggest__item img, .suggest__letter { width: 28px; height: 28px; flex: none; }
.suggest__letter { display: grid; place-items: center; color: #fff; font-weight: 500; border-radius: 18%; }
.suggest__text { display: flex; flex-direction: column; min-width: 0; line-height: 17px; }
.suggest__dev { color: var(--secondary); font-size: 12px; }
.suggest__empty { padding: 10px 12px; color: var(--muted); }

/* Tools row popovers */
.tools-row__icons { position: relative; }
.tool { position: relative; }
.popover--qr, .popover--share, .popover--subscribe { top: 34px; right: 0; }
.popover--qr { min-width: 0; padding: 12px; text-align: center; }
.popover--qr .popover__text { padding: 0; margin: 6px 0 0; font-size: 12px; }
.qr-code svg { display: block; width: 160px; height: 160px; }
.popover--subscribe { width: 280px; padding: 12px 0; }
.subscribe-form input[type="email"] { width: calc(100% - 32px); margin: 0 16px; }
.subscribe-form .btn { margin: 8px 16px 0; }
.subscribe-form__msg { margin: 6px 16px 0; font-size: 13px; color: var(--secondary); }
.subscribe-form__msg:empty { display: none; }
.subscribe-form__msg.is-error { color: #b42318; }
.subscribe-form a.small { display: inline-flex; width: auto; padding: 6px 0 0 16px; color: var(--accent); }
.follow-card__btn { position: relative; }
.follow-card .popover--subscribe { top: 32px; left: 50%; transform: translateX(-50%); }
button.pill-btn { font-family: var(--font); cursor: pointer; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Notice bar */
.notice-bar { background: #e8f5e9; color: #1e4620; padding: 10px 0; border-bottom: 1px solid #c8e6c9; }

/* Sidebar icon badge */
.sideRow__icon { position: relative; }
.icon-badge { position: absolute; top: -6px; left: 22px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #455a64; color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 500; }
.dev-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-light); color: var(--accent); }

/* Info panel: smooth open/close; whole row clickable */
.appRow__slide { overflow: hidden; transition: height .2s ease; }
.appRow { cursor: pointer; }
.appRow:hover { background: var(--slide); }

/* About pane: 60px fade, Show less */
.pane__clip.is-clipped::after { height: 60px; }
.show-more__btn .ico { transition: transform .2s; }
.show-more__btn[aria-expanded="true"] .ico { transform: rotate(180deg); }
.notes a { color: var(--app-accent); text-decoration: underline; }
.notes ul, .notes ol { padding-left: 20px; }

/* Screenshots: drag to scroll */
.screens { cursor: grab; }
.screens.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.screens.is-dragging a { pointer-events: none; }
.screens img { user-select: none; -webkit-user-drag: none; }

/* Lightbox with arrows */
.lightbox { background: rgba(0, 0, 0, .85); }
.lightbox__btn { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.lightbox__btn:hover { background: rgba(255, 255, 255, .3); }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
.lightbox__close { top: 16px; right: 16px; transform: none; width: 40px; height: 40px; font-size: 24px; }

/* YouTube click-to-load facade (16:9) */
.yt-facade { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #000 center / cover no-repeat; cursor: pointer; }
.yt-facade__play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: .9; transition: opacity .15s; }
.yt-facade:hover .yt-facade__play { opacity: 1; }
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* Forms (upload, contact) */
.apkd-form p { margin: 0 0 14px; }
.apkd-form label { display: block; font-weight: 500; margin-bottom: 4px; }
.apkd-form input[type="text"], .apkd-form input[type="email"], .apkd-form textarea { width: 100%; max-width: 520px; padding: 8px 10px; font: inherit; color: var(--text); background: #fff; border: 1px solid #d5d8da; border-radius: var(--radius); }
.apkd-form small { display: block; color: var(--muted); margin-top: 4px; }
.form-error { background: #fde7e5; color: #b42318; padding: 10px 12px; border-radius: var(--radius); }
.view-page .data-table { margin-top: 6px; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); }
.status--publish { background: #e8f5e9; color: #1e7b34; }
.status--pending { background: var(--beta-soft); color: var(--beta); }
.status--trash { background: var(--alpha-soft); color: var(--alpha); }
.search-title { margin: 0 0 12px; font-size: 20px; }

/* Reserved ad heights (no layout jump) */
.ad-slot--billboard .ad-body--reserved { min-height: 250px; }
.ad-slot--inlist .ad-body--reserved, .ad-slot--card .ad-body--reserved { min-height: 280px; }
.ad-slot--sidebar .ad-body--reserved { min-height: 250px; }
.ad-label a { color: inherit; }

/* Promo pop-up: slim bottom bar on phones */
@media (max-width: 767px) {
	.promo-popup { left: 0; right: 0; bottom: 0; width: auto; border-radius: 0; padding: 10px 44px 10px 14px; display: flex; align-items: center; gap: 10px; text-align: left; }
	.promo-popup[hidden] { display: none; }
	.promo-popup p { margin: 0; font-size: 13px; line-height: 17px; flex: 1; }
	.promo-popup__close { top: 50%; transform: translateY(-50%); }
	.popover--filter, .popover--account { position: fixed; top: auto; left: 8px; right: 8px; width: auto; }
	.popover--subscribe, .popover--share { right: -40px; }
}

/* ---------------------------------------------------------------------------
   Dark mode (Premium setting)
--------------------------------------------------------------------------- */
body.dark-mode {
	--bg: #121416;
	--card: #1c1f22;
	--slide: #24282c;
	--text: #d7dadc;
	--title: #f1f3f4;
	--secondary: #a3a9ae;
	--muted: #8b9196;
	--heading: #9fb3bd;
	--divider: #2c3135;
	--footer-bg: #1c1f22;
	--footer-text: #8b9196;
	--date: rgba(255, 255, 255, .5);
	color-scheme: dark;
}
body.dark-mode .title-band, body.dark-mode .tab-bar, body.dark-mode .pane, body.dark-mode .popover, body.dark-mode .suggest,
body.dark-mode .show-more__btn, body.dark-mode .btn:not(.btn--primary), body.dark-mode .apkd-form input, body.dark-mode .apkd-form textarea,
body.dark-mode .popover select, body.dark-mode .popover input[type="email"], body.dark-mode .search-form__input { background: var(--card); color: var(--text); border-color: var(--divider); }
body.dark-mode .title-band__name, body.dark-mode .title-band__dev, body.dark-mode .title-band__dev a, body.dark-mode .pane__title, body.dark-mode .az { color: var(--title); }
body.dark-mode .pane__clip.is-clipped::after { background: linear-gradient(rgba(28, 31, 34, 0), var(--card)); }
body.dark-mode .pill-btn { background: var(--slide); border-color: var(--divider); color: var(--text); }
body.dark-mode .site-footer { box-shadow: none; border-top: 1px solid var(--divider); }
body.dark-mode .ad-placeholder { background: repeating-linear-gradient(45deg, #23272b, #23272b 10px, #272c30 10px, #272c30 20px); }
