@font-face {
    font-family: 'TajawalLocal';
    src: url('../fonts/tajawal.ttf') format('truetype');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Material Symbols Outlined';
    src: url('../fonts/material-symbols-outlined.ttf') format('truetype');
    font-weight: 400 700;
    font-style: normal;
    font-display: block;
}

:root {
    --bg: #f9f7f0;
    --paper: #ffffff;
    --primary: #612c23;
    --primary-dark: #4b211a;
    --accent: #d48444;
    --soft: #f4ece5;
    --line: #dad9d7;
    --text: #231b17;
    --muted: #786960;
    --shadow: 0 18px 46px rgba(97, 44, 35, .12);
    --radius: 18px;
}

* { box-sizing: border-box; }

.material-symbols-outlined,
.material-symbols-rounded {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: 500 !important;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-flex;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

body {
    margin: 0;
    font-family: 'TajawalLocal', Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at 50% -10%, rgba(244,236,229,.85), transparent 34%),
        linear-gradient(180deg, #fffdf8 0, var(--bg) 100%);
    color: var(--text);
    line-height: 1.8;
}

button,
input,
select,
textarea {
    font-family: 'TajawalLocal', Tahoma, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
.container { width: min(1150px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 26px rgba(0,0,0,.04);
}
.nav-wrap { height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; color: var(--primary); font-size: 22px; }
.brand img {
    width: 68px;
    height: 54px;
    object-fit: contain;
    padding: 7px 10px;
    border-radius: 14px;
    border: 1px solid rgba(212,132,68,.28);
    background:
        radial-gradient(circle at center, rgba(124,63,51,.96), var(--primary-dark) 76%),
        linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 24px rgba(97,44,35,.16);
}
.nav-menu { display: flex; align-items: center; gap: 8px; }
.nav-menu a { position: relative; padding: 10px 18px; border-radius: 999px; color: var(--primary); font-weight: 800; }
.nav-menu a:hover, .nav-menu a.active { background: var(--soft); color: var(--primary); }
.nav-menu .play-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(97,44,35,.14);
}
.nav-menu .play-link:hover {
    background: var(--primary-dark);
    color: #fff;
}
.nav-menu .play-link .material-symbols-outlined {
    font-size: 20px;
}
.nav-menu a.active::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    inset-inline: 50%;
    transform: translateX(50%);
    bottom: -7px;
}
.menu-toggle {
    display: none;
    border: 0;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
}

.home-header-image {
    padding: 18px 0 0;
}
.home-header-image .container {
    position: relative;
}
.home-header-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 18px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.home-image-menu {
    display: none;
}
.home-search-block {
    padding-top: 22px;
    display: flex;
    justify-content: center;
}
.home-search-block .hero-search {
    width: min(760px, 100%);
    margin: 0;
    flex-direction: row-reverse;
}
.home-search-block .hero-search button {
    flex: 0 0 64px;
}
.page-head .hero-search {
    width: min(760px, 100%);
    margin: 12px 0 0;
    flex-direction: row-reverse;
}
.page-head .hero-search button {
    flex: 0 0 64px;
}
.home-play-download {
    display: flex;
    justify-content: center;
    padding-top: 12px;
}
.home-play-download .google-play-btn {
    min-height: 44px;
    padding: 8px 13px;
    border-radius: 12px;
}
.home-play-download .google-play-btn svg {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}
.home-play-download .google-play-btn strong {
    font-size: 15px;
}
.home-play-download .google-play-btn span {
    font-size: 11px;
}
.home-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.home-shortcuts a {
    min-height: 46px;
    padding: 9px 12px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.86);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 8px 18px rgba(97,44,35,.06);
}
.home-shortcuts a:hover {
    border-color: rgba(212,132,68,.45);
    background: #fff;
}
.home-shortcuts .material-symbols-outlined {
    font-size: 20px;
    color: var(--accent);
}
.home-shortcuts strong {
    font-size: 14px;
    line-height: 1.2;
}
.home-browse-types {
    margin-top: 12px;
}
.home-browse-types .home-shortcuts {
    margin-top: 7px;
}
.browse-title {
    color: var(--primary);
    font-weight: 900;
    font-size: 15px;
    line-height: 1.2;
}

.hero { padding: 34px 0 20px; }
.app-download-strip {
    padding: 14px 0 0;
}
.app-download-strip .container {
    display: flex;
    justify-content: center;
}
.hero-grid { display: grid; grid-template-columns: .72fr 1.7fr; gap: 18px; align-items: stretch; }
.hero-content, .hero-card, .content-box, .material-detail {
    background: rgba(255,255,255,.94);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-content {
    min-height: 420px;
    padding: clamp(28px, 5vw, 62px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background:
        linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,253,248,.88)),
        radial-gradient(circle at 15% 35%, rgba(244,236,229,.88), transparent 34%);
}
.hero-content::before {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 120px;
    background: linear-gradient(90deg, transparent, rgba(212,132,68,.16));
    border-radius: 80px 0 0 80px;
}
.hero-content::after {
    content: "";
    position: absolute;
    left: 58px;
    bottom: 58px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,132,68,.18), transparent 70%);
}
.hero-panel {
    display: contents;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--soft);
    color: var(--primary);
    border: 1px solid rgba(97,44,35,.10);
    padding: 7px 18px;
    border-radius: 999px;
    font-weight: 900;
}
.eyebrow .material-symbols-outlined, .eyebrow .material-symbols-rounded { color: var(--accent); font-size: 20px; }
h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.35; margin: 12px 0 8px; color: var(--primary); font-weight: 900; }
h2 { color: var(--primary); margin: 0 0 12px; }
.hero-content p, .page-head p { color: var(--muted); max-width: 700px; }

.hero-search, .search-line {
    display: flex;
    gap: 10px;
    background: #fff;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    margin: 24px 0 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 12px 28px rgba(97,44,35,.06);
}
.hero-search { width: min(650px, 100%); flex-direction: row-reverse; }
.hero-search input, .search-line input { flex: 1; border: 0; outline: 0; padding: 12px 14px; font-size: 16px; background: transparent; }
button, .btn { cursor: pointer; }
.hero-search button, .btn {
    border: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 11px 22px;
    border-radius: 12px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 12px 24px rgba(97,44,35,.16);
}
.hero-search button { width: 56px; height: 52px; padding: 0; line-height: 1; }
.hero-search button .material-symbols-outlined, .hero-search button .material-symbols-rounded { color: #fff; font-size: 30px; }
.hero-search button:hover, .btn:hover { background: var(--primary-dark); }
.btn.ghost { background: var(--soft); color: var(--primary); border: 1px solid var(--line); box-shadow: none; }
.btn.small { padding: 7px 12px; border-radius: 11px; font-size: 14px; }
.btn .material-symbols-outlined, .btn .material-symbols-rounded { font-size: 21px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.google-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #122238;
    color: #fff;
    font-weight: 900;
    line-height: 1.15;
    box-shadow: 0 12px 24px rgba(18,34,56,.18);
}
.google-play-btn span { font-size: 12px; text-align: start; }
.google-play-btn strong { display: inline-block; direction: ltr; font-size: 17px; color: #fff; }
.google-play-btn svg {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 5px;
    border-radius: 9px;
    background: #fff;
}

.hero-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,253,247,.98)),
        repeating-linear-gradient(45deg, rgba(212,132,68,.05) 0 1px, transparent 1px 16px);
}
.logo-panel {
    width: min(230px, 82%);
    margin: 0 auto 22px;
    padding: 22px;
    border-radius: 24px;
    background:
        radial-gradient(circle at center, rgba(127,65,52,.97), var(--primary-dark) 78%),
        linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 1px solid rgba(212,132,68,.34);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.06),
        0 18px 42px rgba(97,44,35,.18);
}
.hero-logo { width: 100%; height: auto; margin: 0 auto; display: block; }
.book-mark { margin: 18px auto 0; color: rgba(97,44,35,.28); }
.book-mark .material-symbols-outlined, .book-mark .material-symbols-rounded { font-size: 82px; font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 48; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 28px auto; }
.stat {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    text-align: center;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px 14px;
}
.stat-icon {
    grid-row: span 2;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff8ef, var(--soft));
    color: var(--primary);
    font-size: 31px;
    box-shadow: inset 0 0 0 1px rgba(212,132,68,.13);
}
.stat strong { display: block; color: var(--primary); font-size: 32px; line-height: 1; }
.stat span { color: var(--muted); }
.compact-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px auto 8px;
}
.compact-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 76px;
    padding: 10px 6px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(97,44,35,.07);
}
.compact-stats .stat-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
}
.compact-stats .stat strong {
    font-size: 18px;
}
.compact-stats .stat span:last-child {
    font-size: 11px;
    line-height: 1.2;
}

.section-block { margin-top: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title h2 { font-size: 20px; position: relative; }
.section-title h2::after { content: ""; display: block; width: 90px; height: 2px; margin-top: 4px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.section-title a { color: var(--accent); font-weight: 800; }
.recent-section {
    margin-top: 18px;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    box-shadow: 0 12px 28px rgba(97,44,35,.14);
}
.recent-section .section-title {
    margin-bottom: 10px;
}
.recent-section .section-title h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}
.recent-section .section-title h2::after {
    width: 54px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent);
}
.recent-section .section-title a {
    color: #ffe6d1;
    font-size: 13px;
}
.recent-section .materials-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
}
.recent-section .material-card {
    min-height: 145px;
    padding: 13px;
    box-shadow: none;
    border-color: rgba(255,255,255,.22);
}

.category-grid, .authors-grid, .materials-grid { display: grid; gap: 16px; }
.category-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.category-grid.wide { margin-bottom: 40px; }
.category-card, .author-card, .material-card, .news-card {
    background: rgba(255,255,255,.96);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: .2s ease;
}
.category-card:hover, .author-card:hover, .material-card:hover { transform: translateY(-3px); border-color: rgba(212,132,68,.55); }
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 152px;
    text-align: center;
}
.cat-icon {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    overflow: hidden;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #fff8ef, var(--soft));
    color: var(--primary);
    font-size: 30px;
    box-shadow: inset 0 0 0 1px rgba(212,132,68,.14);
}
.cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cat-icon .material-symbols-outlined,
.cat-icon .material-symbols-rounded {
    font-size: 30px;
}
.featured-cat { min-height: 152px; }
.cat-text {
    min-width: 0;
    display: grid;
    gap: 2px;
    justify-items: center;
}
.category-card strong, .author-card strong { color: var(--primary); display: block; margin: 8px 0 3px; }
.category-card strong {
    margin: 0;
    line-height: 1.45;
}
.category-card small, .author-card small, .muted { color: var(--muted); }
.category-card small {
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.authors-grid {
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}
.author-card {
    min-height: 128px;
    padding: 16px;
    display: grid;
    grid-template-columns: 56px 1fr;
    grid-template-rows: 1fr auto;
    align-items: start;
    gap: 12px 14px;
    text-align: start;
}
.author-icon {
    width: 56px;
    height: 56px;
    margin: 0;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eef4f5;
    color: var(--primary);
    font-size: 28px;
    box-shadow: inset 0 0 0 1px rgba(97,44,35,.08);
}
.author-text {
    min-width: 0;
}
.author-card strong {
    margin: 0;
    line-height: 1.35;
}
.author-card small {
    display: block;
    margin-top: 3px;
    line-height: 1.3;
}
.author-arrow {
    grid-column: 1 / -1;
    color: var(--accent);
    font-size: 22px;
    justify-self: end;
}
.materials-grid {
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 12px;
}

.material-card {
    display: grid;
    grid-template-columns: 46px 1fr;
    grid-template-rows: 1fr auto;
    align-items: start;
    gap: 10px 12px;
    min-height: 150px;
    padding: 14px;
}
.card-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: #eef4f5;
    color: var(--primary);
    border-radius: 15px;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(97,44,35,.08);
}
.card-icon .material-symbols-outlined, .card-icon .material-symbols-rounded { font-size: 25px; }
.card-body {
    min-width: 0;
}
.card-body h3 {
    margin: 0;
    color: var(--primary);
    line-height: 1.45;
    font-size: 17px;
}
.card-body h3 a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.card-body p { margin: 4px 0 0; color: var(--muted); }
.material-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}
.material-desc {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    font-size: 13px;
}
.badge { display: inline-flex; background: #fff3e8; color: var(--accent); border: 1px solid #f2d6bf; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 800; }
.card-actions, .detail-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.material-card .card-actions {
    grid-column: 1 / -1;
    margin-top: 0;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-start;
}
.card-actions .download-btn { width: 42px; padding-inline: 0; flex: 0 0 42px; }
.icon-btn { border: 1px solid var(--line); background: #fff; color: var(--primary); min-width: 42px; min-height: 38px; border-radius: 12px; font-weight: 900; }
.icon-btn.active, .fav-btn.active { background: #fff0f0; color: #b41631; border-color: #f4c7cf; }
.material-open.fav-btn.active {
    background: #fff0f0;
    color: #b41631;
    border-color: #f4c7cf;
}
.material-open {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    display: inline-grid;
    place-items: center;
    padding: 0;
    box-shadow: none;
    font-weight: 900;
}
.material-open .material-symbols-outlined {
    font-size: 20px;
}
.material-open:hover {
    border-color: rgba(212,132,68,.55);
    background: var(--soft);
}

.page-head { padding: 22px 0 14px; }
.page-head h1 { margin-bottom: 5px; }
.material-page { padding: 34px 0; }
.material-detail { display: grid; grid-template-columns: 100px 1fr; gap: 24px; padding: clamp(20px, 4vw, 38px); margin-bottom: 20px; }
.detail-icon { width: 88px; height: 88px; border-radius: 24px; background: var(--soft); display: grid; place-items: center; font-size: 48px; }
.detail-meta {
    display: grid;
    gap: 6px;
    margin: 10px 0 18px;
    color: var(--muted);
}
.detail-meta div {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.detail-meta .material-symbols-outlined {
    color: var(--accent);
    font-size: 19px;
}
.detail-meta strong {
    color: var(--primary);
}
.detail-meta a {
    color: var(--muted);
}
.detail-actions audio { width: min(100%, 420px); }
.content-box { padding: 26px; }
.article-text { white-space: pre-line; font-size: 18px; color: #2d2724; }
.news-list { display: grid; gap: 16px; }
.empty { grid-column: 1 / -1; background: var(--paper); border: 1px dashed var(--line); border-radius: 18px; padding: 22px; color: var(--muted); text-align: center; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 30px 0; }

.site-footer { margin-top: 45px; background: var(--primary-dark); color: #fff; padding: 28px 0 18px; }
.footer-grid { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.site-footer p { color: rgba(255,255,255,.8); margin: 0; }
.footer-links { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-links a { background: rgba(255,255,255,.12); padding: 8px 13px; border-radius: 999px; }
.footer-links .footer-play-btn {
    min-width: 172px;
    justify-content: center;
    border-radius: 12px;
    background: #10233c;
    color: #fff;
    padding: 8px 14px;
}
.footer-links .footer-play-btn:hover {
    background: #0c1b2f;
}
.designer-credit {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.14);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    color: rgba(255,255,255,.82);
    flex-wrap: wrap;
}
.designer-credit .material-symbols-outlined {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(212,132,68,.18);
    color: var(--accent);
    font-size: 21px;
}
.designer-credit strong { color: #fff; font-weight: 900; }
.designer-credit a {
    color: #fff;
    background: rgba(212,132,68,.22);
    border: 1px solid rgba(212,132,68,.35);
    padding: 5px 12px;
    border-radius: 999px;
    direction: ltr;
}
#globalAudio { position: sticky; bottom: 0; width: 100%; z-index: 30; background: #fff; padding: 8px; }

@media (max-width: 820px) {
    .menu-toggle { display: inline-flex; }
    .nav-menu { position: absolute; top: 82px; inset-inline: 16px; display: none; flex-direction: column; background: #fff; padding: 12px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
    .nav-menu.open { display: flex; }
    .nav-menu a { width: 100%; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-content {
        border: 0;
        box-shadow: none;
        background: transparent;
        padding-inline: 0;
        overflow: visible;
    }
    .hero-content::before,
    .hero-content::after { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .compact-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    .search-line { flex-direction: column; }
    .hero-search { flex-direction: row-reverse; }
    .hero-search {
        width: 100%;
        max-width: 100%;
        border-radius: 14px;
    }
    .hero-search button { width: 56px; flex: 0 0 56px; }
    .search-line .btn { width: 100%; }
    .hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 14px;
        justify-items: stretch;
    }
    .hero-actions .btn,
    .hero-actions .google-play-btn {
        width: 100%;
        max-width: none;
        min-height: 52px;
        justify-content: center;
    }
    .material-detail { grid-template-columns: 1fr; }
    .footer-grid { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
    .home-page .site-header {
        height: 0;
        min-height: 0;
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
    }
    .home-page .site-header .nav-wrap {
        height: 0;
    }
    .home-page .site-header .brand,
    .home-page .site-header .menu-toggle {
        display: none;
    }
    .home-page .nav-menu {
        top: 48px;
        z-index: 40;
    }
    .container { width: min(100% - 22px, 1150px); }
    .home-header-image {
        padding-top: 10px;
    }
    .home-header-image .container {
        width: min(100% - 22px, 1150px);
    }
    .home-header-image img {
        border-radius: 14px;
    }
    .home-image-menu {
        position: absolute;
        inset-block-start: 10px;
        inset-inline-start: 10px;
        z-index: 35;
        display: inline-flex;
        width: 34px;
        height: 34px;
        border-radius: 11px;
        background: rgba(97,44,35,.92);
        color: #fff;
        box-shadow: 0 8px 18px rgba(0,0,0,.18);
    }
    .home-image-menu .material-symbols-outlined {
        font-size: 24px;
    }
    .home-search-block {
        padding-top: 16px;
    }
    .home-play-download {
        padding-top: 9px;
    }
    .home-play-download .google-play-btn {
        min-height: 40px;
        padding: 7px 11px;
    }
    .home-play-download .google-play-btn svg {
        width: 25px;
        height: 25px;
        flex-basis: 25px;
    }
    .home-search-block .hero-search {
        flex-direction: row-reverse !important;
    }
    .home-search-block .hero-search button {
        width: 56px !important;
        flex-basis: 56px;
    }
    .home-shortcuts {
        gap: 8px;
        margin-top: 10px;
    }
    .home-shortcuts a {
        min-height: 42px;
        padding: 8px 9px;
        border-radius: 12px;
    }
    .home-shortcuts strong {
        font-size: 12px;
    }
    .home-shortcuts .material-symbols-outlined {
        font-size: 18px;
    }
    .home-browse-types {
        margin-top: 10px;
    }
    .browse-title {
        font-size: 13px;
    }
    .recent-section {
        margin-top: 14px;
        padding: 9px;
        border-radius: 14px;
    }
    .recent-section .section-title h2 {
        font-size: 17px;
    }
    .recent-section .section-title a {
        font-size: 12px;
    }
    .recent-section .material-card {
        min-height: 72px;
        padding: 9px;
    }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .compact-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        margin-top: 12px;
    }
    .stat {
        padding: 14px 10px;
        border-radius: 12px;
        grid-template-columns: 1fr auto;
        gap: 4px 8px;
        text-align: start;
        min-width: 0;
    }
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    .stat strong { font-size: 25px; }
    .stat span { font-size: 13px; }
    .compact-stats .stat {
        min-height: 66px;
        padding: 8px 4px;
        border-radius: 12px;
    }
    .compact-stats .stat-icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    .compact-stats .stat strong {
        font-size: 16px;
    }
    .compact-stats .stat span:last-child {
        font-size: 10px;
    }
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .category-card {
        min-height: 132px;
        padding: 14px 10px;
        gap: 9px;
        border-radius: 14px;
    }
    .cat-icon {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }
    .cat-icon .material-symbols-outlined,
    .cat-icon .material-symbols-rounded {
        font-size: 24px;
    }
    .category-card strong {
        font-size: 14px;
        overflow-wrap: anywhere;
    }
    .category-card small {
        font-size: 11px;
    }
    .authors-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .author-card {
        min-height: 78px;
        padding: 11px 13px;
        grid-template-columns: 46px 1fr 24px;
        grid-template-rows: auto;
        align-items: center;
        gap: 10px;
    }
    .author-icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        font-size: 24px;
    }
    .author-arrow {
        grid-column: auto;
        font-size: 20px;
    }
    .author-card strong {
        font-size: 14px;
    }
    .author-card small {
        font-size: 11px;
    }
    .materials-grid { grid-template-columns: 1fr; gap: 10px; }
    .material-card {
        grid-template-columns: 38px minmax(0, 1fr) 60px;
        grid-template-rows: auto;
        align-items: center;
        min-height: 82px;
        padding: 11px 10px;
        gap: 8px;
        border-radius: 14px;
    }
    .card-icon { width: 38px; height: 38px; border-radius: 13px; }
    .card-icon .material-symbols-outlined, .card-icon .material-symbols-rounded { font-size: 22px; }
    .card-body { min-width: 0; }
    .card-body h3 { font-size: 14px; overflow-wrap: anywhere; }
    .material-meta,
    .material-desc { font-size: 11px; }
    .material-card .badge {
        padding: 1px 7px;
        font-size: 10px;
    }
    .material-card .card-actions {
        grid-column: auto;
        display: grid;
        grid-template-columns: repeat(2, 28px);
        grid-auto-rows: 28px;
        gap: 4px;
        align-content: center;
        justify-content: end;
    }
    .material-open {
        width: 28px;
        height: 28px;
    }
    .material-open .material-symbols-outlined {
        font-size: 16px;
    }
    .detail-actions .btn,
    .detail-actions .icon-btn { width: 100%; }
    .brand img { width: 58px; height: 46px; padding: 6px 8px; }
    .brand span { font-size: 14px; }
    .hero-content {
        padding: 20px 0;
        min-height: auto;
    }
    .hero-search { margin: 20px 0 14px; }
    .hero-actions .btn,
    .hero-actions .google-play-btn {
        width: 100%;
        max-width: none;
        padding-inline: 16px;
    }
}

@media (max-width: 390px) {
    .container { width: min(100% - 18px, 1150px); }
    .stats-grid { grid-template-columns: 1fr; }
    .compact-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    .stat {
        grid-template-columns: auto 1fr;
        text-align: center;
        padding: 16px;
    }
    .compact-stats .stat {
        display: flex;
        padding: 7px 3px;
    }
    .hero-actions .btn {
        width: 100%;
        max-width: none;
    }
    .section-title h2 { font-size: 17px; }
}

@media (max-width: 820px) {
    .hero {
        padding-top: 18px;
    }

    .hero-grid {
        display: block;
    }

    .hero-card {
        display: none;
    }

    .hero-content {
        width: 100% !important;
        min-height: 0 !important;
        padding: 18px 0 8px !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .hero-panel {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 24px 16px 18px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background:
            linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,253,248,.92)),
            radial-gradient(circle at 95% 10%, rgba(212,132,68,.12), transparent 36%);
        box-shadow: 0 16px 34px rgba(97,44,35,.10);
    }

    .hero-content::before,
    .hero-content::after {
        display: none !important;
    }

    .hero-content .hero-search,
    .hero-actions {
        width: min(100%, 275px) !important;
        margin-inline: auto !important;
    }

    .hero-actions {
        margin-top: 14px !important;
    }

    .hero-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .hero-actions .btn,
    .hero-actions .google-play-btn {
        width: 100% !important;
        min-height: 52px;
    }
}

@media (max-width: 520px) {
    .home-search-block {
        width: min(100% - 22px, 1150px);
        padding-top: 10px;
    }

    .home-search-block .hero-search {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 6px;
        gap: 6px;
        border-radius: 13px;
    }

    .home-search-block .hero-search input {
        min-width: 0;
        padding: 8px 10px;
        font-size: 13px;
    }

    .home-search-block .hero-search button {
        width: 44px !important;
        height: 42px;
        flex: 0 0 44px;
        border-radius: 11px;
    }

    .home-search-block .hero-search button .material-symbols-outlined {
        font-size: 24px;
    }
    .page-head .hero-search {
        width: 100% !important;
        max-width: none !important;
        margin-top: 10px !important;
        padding: 6px;
        gap: 6px;
        border-radius: 13px;
        flex-direction: row-reverse !important;
    }

    .page-head .hero-search input {
        min-width: 0;
        padding: 8px 10px;
        font-size: 13px;
    }

    .page-head .hero-search button {
        width: 44px !important;
        height: 42px;
        flex: 0 0 44px;
        border-radius: 11px;
    }

    .page-head .hero-search button .material-symbols-outlined {
        font-size: 24px;
    }
}
