:root {
    --bg: #f4f6f7;
    --surface: #ffffff;
    --text: #1b2126;
    --muted: #6b7580;
    --border: #e4e8eb;
    --accent: #00a99a;
    --accent-dark: #00897c;
    --tag-bg: #eaf7f5;
    --tag-text: #00897c;
    --radius: 8px;
    --wrap: 1180px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
a { color: inherit; }

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 60px;
}
.logo {
    font-weight: 800;
    font-size: 21px;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}
.logo span { color: var(--accent); }

.nav { display: flex; gap: 18px; flex-shrink: 0; }
.nav a {
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 0;
}
.nav a:hover { color: var(--accent); }

.search { display: flex; flex: 1; max-width: 420px; margin-left: auto; }
.search input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
}
.search input:focus { outline: none; border-color: var(--accent); }
.search button {
    padding: 9px 16px;
    border: none;
    background: var(--accent);
    color: #fff;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    font-weight: 600;
}
.search button:hover { background: var(--accent-dark); }

main {
    flex: 1 0 auto;
    padding: 32px 16px 56px;
}

/* Category strip */
.cat-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-top: 8px;
    margin-bottom: 32px;
    padding-bottom: 4px;
}
.cat-strip a {
    white-space: nowrap;
    padding: 7px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.cat-strip a.is-active,
.cat-strip a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Sections */
.catalog-section { margin-bottom: 36px; }
.catalog-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}
.catalog-section__head h2 { font-size: 19px; margin: 0; }
.catalog-section__head a { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; }

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .15s, transform .15s;
}
.app-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-2px); }
.app-card__link { display: block; padding: 14px; text-decoration: none; color: var(--text); }
.app-card__icon { border-radius: 14px; display: block; margin-bottom: 10px; }
.app-card__name {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.app-card__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.tag {
    font-size: 11px;
    font-weight: 700;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 2px 7px;
    border-radius: 4px;
}
.app-card__rating { color: #f5a623; font-size: 12px; margin: 0; font-weight: 600; }
.app-card__rating span { color: var(--muted); font-weight: 400; }

/* Breadcrumbs */
.breadcrumbs { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

/* App detail */
.app-detail__header { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.app-detail__icon { border-radius: 18px; border: 1px solid var(--border); }
.app-detail__meta { color: var(--muted); margin: 4px 0 6px; font-size: 14px; }
.app-detail__rating { color: #f5a623; margin: 0; font-weight: 700; font-size: 14px; }
.app-detail__rating span { color: var(--muted); font-weight: 400; }

.btn-download {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 13px 32px;
    border-radius: var(--radius);
    font-weight: 700;
    margin: 8px 0 28px;
}
.btn-download:hover { background: var(--accent-dark); }
.btn-download--big { font-size: 18px; padding: 16px 40px; }

.screenshots { display: flex; gap: 12px; overflow-x: auto; margin-bottom: 28px; }
.screenshots img { height: 220px; border-radius: var(--radius); flex-shrink: 0; border: 1px solid var(--border); }

.app-detail__description,
.app-detail__specs {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.app-detail__description h2,
.app-detail__specs h2 { font-size: 16px; margin: 0 0 10px; }

.app-detail__specs dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.app-detail__specs dt { color: var(--muted); }
.app-detail__specs dd { margin: 0; font-weight: 600; }

/* Download page */
.download-page { text-align: center; max-width: 480px; margin: 20px auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 24px; }
.download-page__icon { border-radius: 18px; margin-bottom: 12px; border: 1px solid var(--border); }
.download-page__meta { color: var(--muted); }
.download-page__hint { color: var(--muted); font-size: 13px; }
.back-link { color: var(--accent); text-decoration: none; font-size: 14px; }

.not-found { text-align: center; padding: 60px 0; }
.not-found a { color: var(--accent); }

/* Footer */
.site-footer { background: #14202b; color: #a6b0b8; margin-top: 40px; }
.site-footer .wrap { padding: 32px 16px 24px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin-bottom: 20px; }
.footer-cols h3 { color: #fff; font-size: 14px; margin: 0 0 10px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: 6px; }
.footer-cols a { color: #a6b0b8; text-decoration: none; font-size: 13px; }
.footer-cols a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #223140; padding-top: 16px; font-size: 12px; }

@media (max-width: 640px) {
    .nav { display: none; }
    .search { max-width: none; }
}
