@media (max-width: 782px) {
  html { background: #eef1f5; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); background: #f5f6f8; font-size: 14px; -webkit-tap-highlight-color: transparent; }
  .site-shell { width: calc(100% - (var(--mobile-pad) * 2)); }

  /* App chrome */
  .site-header { position: sticky; top: 0; z-index: 100; box-shadow: 0 5px 24px rgba(13,24,44,.08); }
  .breaking-bar { height: 32px; }
  .breaking-bar__inner { width: calc(100% - 24px); height: 32px; gap: 8px; }
  .breaking-bar__label { font-size: 9px; }
  .breaking-bar__story { font-size: 9px; }
  .breaking-bar__actions { display: none; }
  .main-header__inner { display: flex; justify-content: space-between; min-height: 62px; width: calc(100% - 28px); gap: 10px; }
  .madar-logo--header img { width: auto; height: 41px; max-width: 150px; }
  .primary-navigation, .account-link { display: none; }
  .header-actions { gap: 2px; }
  .icon-button { display: grid; width: 39px; height: 39px; color: #263248; background: #f2f4f8; }
  .menu-toggle { display: grid; }
  .menu-open .menu-toggle i::before { content: "\f00d"; }
  .header-search { position: fixed; z-index: 105; top: var(--madar-mobile-header-offset,94px); right: 0; left: 0; padding: 8px 0; }
  .header-search .site-shell { width: calc(100% - 28px); padding: 0; }
  .header-search .search-form { gap: 7px; margin-left: 42px; }
  .search-field { min-height: 45px; background: #f7f8fa; border: 0; }
  .search-submit { min-width: 74px; }
  .mobile-navigation { position: fixed; z-index: 104; top: var(--madar-mobile-header-offset,94px); right: 0; bottom: 0; left: 0; padding: 20px 18px 100px; overflow-y: auto; background: rgba(9,17,31,.97); backdrop-filter: blur(14px); }
  .mobile-menu { display: grid; gap: 6px; }
  .mobile-menu a { display: flex; align-items: center; min-height: 51px; padding: 11px 16px; color: #fff; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; font-size: 14px; font-weight: 750; }
  .mobile-menu .sub-menu { padding: 5px 16px 8px 0; list-style: none; }
  .mobile-menu .sub-menu a { min-height: 43px; color: #bfc8d7; background: transparent; border: 0; font-size: 12px; }

  /* Hero becomes the app's visual top story */
  .home-hero { min-height: 0; padding: 0 0 18px; background: #fff; }
  .home-hero__lead { height: clamp(440px,118vw,555px); margin: 0 12px; overflow: hidden; border-radius: 0 0 23px 23px; box-shadow: 0 18px 40px rgba(8,17,33,.18); }
  .home-hero__background::after { background: linear-gradient(0deg,rgba(5,11,22,.96),rgba(5,11,22,.03) 72%),linear-gradient(90deg,rgba(5,10,20,.08),rgba(5,10,20,.35)); }
  .home-hero__background img { object-position: center; }
  .home-hero__inner { align-items: flex-end; width: 100%; padding: 32px 23px; }
  .home-hero__content { width: 100%; padding: 0; }
  .hero-kicker { margin-bottom: 11px; font-size: 9px; }
  .post-category { padding: 5px 9px; font-size: 9px; border-radius: 5px; }
  .home-hero h1 { margin-bottom: 18px; font-size: clamp(27px,8.2vw,38px); line-height: 1.45; letter-spacing: -.025em; }
  .home-hero .post-meta { gap: 12px; font-size: 8px; }
  .home-hero .post-meta__item:nth-child(3), .home-hero .post-meta__item:nth-child(4) { display: none; }
  .hero-side-widget { display: none; }
  .hero-rail-wrap { height: auto; width: 100%; }
  .hero-rail { position: static; display: flex; gap: 12px; width: auto; min-height: 0; padding: 19px 18px 5px; overflow-x: auto; color: var(--madar-ink); background: #fff; border-radius: 0; box-shadow: none; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .hero-rail::-webkit-scrollbar { display: none; }
  .hero-rail__card { flex: 0 0 84%; grid-template-columns: 102px 1fr; min-height: 110px; padding: 10px; background: #f5f7fa; border: 1px solid #edf0f5; border-radius: 14px; scroll-snap-align: center; }
  .hero-rail__card + .hero-rail__card { border-right: 1px solid #edf0f5; }
  .hero-rail__image { height: 88px; border-radius: 10px; }
  .hero-rail h2 { font-size: 12px; }

  /* App section cards */
  .home-section { padding: 30px 0; background: #fff; }
  .featured-section { margin: 10px 0; background: #f2f4f7; }
  .categories-section { padding-bottom: 40px; }
  .home-section__header { display: grid; grid-template-columns: auto 1fr; gap: 13px; margin-bottom: 19px; }
  .home-section__header h2 { font-size: 20px; }
  .home-section__header nav { grid-column: 1/-1; gap: 8px; overflow-x: auto; padding-bottom: 2px; white-space: nowrap; scrollbar-width: none; }
  .home-section__header nav a { padding: 6px 12px; background: #f3f5f8; border-radius: 20px; font-size: 9px; }
  .home-section__header nav a.is-active { color: #fff; background: var(--madar-red); }
  .home-section__header--compact { grid-template-columns: auto 1fr auto; }
  .slider-arrows { display: none; }
  .trending-grid, .featured-grid, .categories-grid { display: block; min-height: 0; }
  .trending-lead { min-height: 365px; border-radius: 18px; box-shadow: 0 13px 32px rgba(15,26,46,.13); }
  .story-overlay__content { padding: 23px; }
  .story-overlay h3 { font-size: 19px; }
  .trending-list { margin-top: 16px; }
  .mini-story { grid-template-columns: 100px 1fr; min-height: 112px; padding: 13px 0; }
  .mini-story:first-child { padding-top: 13px; }
  .mini-story__image { height: 88px; border-radius: 12px; }
  .mini-story h3 { font-size: 12px; }
  .category-widget, .social-widget { display: none; }
  .featured-standard { border-radius: 16px; box-shadow: 0 12px 28px rgba(15,26,46,.08); }
  .featured-standard__image { height: 245px; }
  .featured-standard > div { padding: 19px; }
  .featured-standard h3 { font-size: 16px; }
  .featured-stack { display: flex; gap: 13px; margin: 17px -18px 0; padding: 0 18px 7px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .featured-overlay { flex: 0 0 86%; min-height: 250px; border-radius: 16px; scroll-snap-align: center; }
  .categories-grid { display: flex; gap: 13px; margin: 0 -18px; padding: 0 18px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .categories-grid > * { flex: 0 0 86%; scroll-snap-align: center; }
  .category-column { display: flex; gap: 13px; }
  .category-column .category-story { flex: 0 0 100%; }
  .category-column .category-story:nth-child(2) { display: none; }
  .category-story { overflow: hidden; background: #f7f8fa; border-radius: 15px; }
  .category-story__image, .category-story--main .category-story__image { height: 265px; border-radius: 15px 15px 0 0; }
  .category-story > div { padding: 16px; }
  .category-story h3, .category-story--main h3 { font-size: 15px; }
  .home-section__header > p { grid-column: 1/-1; margin: -5px 0 0; font-size: 10px; }
  .section-more { grid-column: 1/-1; width: max-content; }
  .topic-hubs-section { background: var(--madar-navy); }
  .topic-hubs-grid { display: flex; gap: 12px; margin: 0 -18px; padding: 0 18px 7px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .topic-hub { flex: 0 0 82%; min-height: 315px; border-radius: 17px; scroll-snap-align: center; }
  .latest-layout { display: block; }
  .latest-lead { min-height: 370px; border-radius: 18px; }
  .latest-lead p { font-size: 10px; }
  .latest-cards { display: flex; gap: 12px; margin: 15px -18px 0; padding: 0 18px 7px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .latest-card { flex: 0 0 82%; scroll-snap-align: center; border-radius: 15px; }
  .latest-card__image { height: 180px; }
  .reading-rank { margin-top: 18px; border-radius: 16px; }
  .newsletter-section { display: flex; flex-direction: column; width: calc(100% - 24px); min-height: 0; padding: 28px 20px 20px; margin-block: 10px 32px; border-radius: 19px; text-align: center; }
  .newsletter-section__visual { order: 1; width: 74px; height: 74px; margin: 0 auto 16px; }
  .newsletter-section__copy { order: 2; }
  .newsletter-section__visual i { font-size: 27px; }
  .newsletter-section h2 { font-size: 22px; }
  .newsletter-section p { font-size: 10px; }
  .newsletter-form { order: 3; width: 100%; margin-top: 19px; padding: 10px; text-align: right; }
  .newsletter-form__row { grid-template-columns: 1fr; gap: 8px; }
  .newsletter-form button { justify-content: center; min-height: 45px; }
  .ad-placement { width: calc(100% - 24px); margin-block: 18px; }
  .ad-placement__content { min-height: 82px; border-radius: 14px; }
  .ad-placement__placeholder i { display: none; }

  /* Category/archive app view */
  .content-shell { padding-block: 28px 45px; }
  .page-header h1 { font-size: 29px; }
  .posts-grid, .category-layout .posts-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
  .post-card { display: grid; grid-template-columns: 125px minmax(0,1fr); border: 0; border-radius: 14px; box-shadow: 0 7px 22px rgba(16,25,42,.06); }
  .post-card__image { height: 100%; min-height: 155px; }
  .post-card__body { padding: 15px; }
  .post-card__title { margin: 8px 0; font-size: 14px; }
  .post-card__excerpt { display: none; }
  .post-card .post-meta__item:not(:first-child) { display: none; }
  .category-hero__inner { grid-template-columns: 1fr; min-height: 210px; padding-block: 38px; }
  .category-hero h1 { font-size: 37px; }
  .category-hero__count { margin-top: 20px; }
  .category-hero__count strong { font-size: 34px; }
  .category-content { padding-top: 24px; }
  .category-spotlight { display: block; margin-bottom: 27px; }
  .category-spotlight__lead { min-height: 380px; border-radius: 18px; }
  .category-spotlight__side { display: flex; gap: 12px; margin: 13px -18px 0; padding-inline: 18px; overflow-x: auto; scroll-snap-type: x mandatory; }
  .category-spotlight__side .story-overlay { flex: 0 0 83%; min-height: 220px; scroll-snap-align: center; }
  .category-layout { display: block; }
  .archive-sidebar { display: none; }

  /* Article */
  .single-page { padding-bottom: 40px; }
  .single-article__top { padding: 26px 0 22px; text-align: right; }
  .breadcrumbs { justify-content: flex-start; margin-bottom: 14px; white-space: nowrap; overflow: hidden; }
  .single-article__top h1 { margin: 12px 0 17px; font-size: clamp(26px,7.3vw,34px); line-height: 1.48; }
  .single-article__top .post-meta { justify-content: flex-start; gap: 11px; }
  .single-article__top .post-meta__item:nth-child(3) { display: none; }
  .single-article__image { width: calc(100% - 24px); height: 73vw; max-height: 430px; margin-inline: auto; border-radius: 18px; }
  .article-layout { display: block; width: calc(100% - 36px); padding-top: 29px; }
  .entry-content { font-size: 16px; line-height: 2.05; }
  .entry-content > p:first-child { font-size: 18px; }
  .entry-content h2 { font-size: 24px; }
  .entry-content blockquote { padding: 19px; font-size: 17px; }
  .article-sidebar { display: none; }
  .share-box { position: relative; justify-content: flex-start; overflow-x: auto; }
  .share-box strong { flex: none; }
  .author-box { grid-template-columns: 58px 1fr; padding: 18px; }
  .related-posts__grid { display: flex; gap: 12px; margin: 0 -18px; padding: 0 18px 6px; overflow-x: auto; scroll-snap-type: x mandatory; }
  .related-card { flex: 0 0 74%; scroll-snap-align: center; }
  .related-card__image { height: 170px; }
  .comments-area { margin-top: 38px; }
  .comment-respond--madar { padding: 21px 16px; border-radius: 15px; }
  .comment-form--madar { grid-template-columns: 1fr; gap: 14px; }
  .comment-form--madar > p { grid-column: 1; }
  .comment-reply-title { font-size: 18px; }
  .madar-comment-submit { width: 100%; }
  .comment-body { padding: 15px; }

  /* Auth */
  .auth-page { min-height: 0; padding: 16px 0 35px; background: #f3f5f8; }
  .auth-shell { display: flex; flex-direction: column; width: calc(100% - 24px); min-height: 0; border-radius: 19px; box-shadow: 0 13px 38px rgba(16,25,42,.11); }
  .auth-visual { min-height: 245px; border-radius: 19px 19px 0 0; }
  .auth-visual__content { right: 24px; bottom: 24px; left: 24px; }
  .auth-visual__content h1 { margin: 8px 0; font-size: 25px; }
  .auth-visual__content p { font-size: 11px; }
  .auth-card { padding: 28px 22px 31px; }
  .auth-card__brand { display: none; }
  .auth-card__heading { margin-bottom: 18px; }
  .auth-card__heading h2 { font-size: 26px; }
  .auth-links { flex-direction: column; align-items: center; }

  /* Footer + native bottom bar */
  .site-footer { margin-top: 0; }
  .site-footer__features .site-shell { display: flex; width: 100%; min-height: 0; padding: 12px; overflow-x: auto; }
  .site-footer__features .site-shell > div { flex: 0 0 78%; justify-content: flex-start; min-height: 70px; padding: 0 18px; border-left: 1px solid rgba(255,255,255,.07); }
  .site-footer__grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 32px 22px; padding-block: 42px 35px; }
  .footer-about, .footer-latest { grid-column: 1/-1; }
  .madar-logo--footer img { height: 57px; max-width: 220px; }
  .footer-about p { max-width: none; }
  .site-footer__basic { display: grid; justify-items: center; min-height: 170px; padding-block: 30px; text-align: center; }
  .site-footer__legal { display: grid; justify-items: center; gap: 13px; padding-block: 20px; text-align: center; }
  .site-footer__legal > div { flex-wrap: wrap; justify-content: center; }
  .mobile-bottom-nav { position: fixed; z-index: 120; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4,1fr); height: calc(65px + env(safe-area-inset-bottom)); padding: 7px 9px env(safe-area-inset-bottom); color: #8a93a1; background: rgba(255,255,255,.96); border-top: 1px solid rgba(16,25,42,.08); box-shadow: 0 -8px 26px rgba(16,25,42,.08); backdrop-filter: blur(14px); }
  .mobile-bottom-nav a, .mobile-bottom-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; color: inherit; background: transparent; border: 0; font: inherit; font-size: 9px; font-weight: 750; cursor: pointer; }
  .mobile-bottom-nav i { font-size: 17px; }
  .mobile-bottom-nav a:hover, .mobile-bottom-nav button:hover, .mobile-bottom-nav a.is-active { color: var(--madar-blue); }
  .mobile-bottom-nav a.is-active::before { content: ""; position: absolute; top: -7px; width: 28px; height: 3px; background: var(--madar-blue); border-radius: 0 0 5px 5px; }
  .madar-license-bar { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; max-width: none; text-align: center; }
}

@media (max-width: 380px) {
  .home-hero__lead { margin-inline: 7px; }
  .home-hero h1 { font-size: 27px; }
  .hero-rail__card { flex-basis: 91%; }
  .post-card { grid-template-columns: 110px minmax(0,1fr); }
  .post-card__body { padding: 12px; }
}
