/* Shared small-screen safeguards for the store and administration pages. */
.detail-info, .section-title-icon, .section-title-icon > div,
.reference-secondary > section, .field, .upload-field,
.panel, .stat-card > div, .header-search { min-width: 0; }
.version-pill, .reference-card-description, .compact-card p,
.app-metrics strong, .drop-area span, .category-chips span,
.stat-card strong, .app-cell strong { overflow-wrap: anywhere; }
.version-pill { max-width: 100%; }
.compact-card .version-pill { white-space: normal; }
.admin-sidebar { height: 100dvh; }
.sidebar-backdrop { display: none; }

@media (max-width: 1050px) {
    .reference-hero h1 { white-space: normal; }
    .reference-tabs { display: flex; overflow-x: auto; padding-bottom: 8px; }
    .reference-tabs a { flex: 0 0 auto; padding: 0 18px; }
}

@media (max-width: 767px) {
    .form-control, .form-select, .reference-search input,
    .header-search input { font-size: 16px; }
    .btn, .reference-download, .compact-card .reference-download,
    .reference-tabs a, .see-all, .reference-search button,
    .reference-nav-links > a, .reference-nav-links > button,
    .dialog-close, .about-close { min-height: 44px; }
    .reference-search { height: 46px; min-width: 0; }
    .reference-search button { padding: 0 6px; }
    .reference-nav-links { height: auto; }
    .reference-nav-links .reference-login { height: 44px; }
    .reference-section-heading, .section-heading, .filter-summary { flex-wrap: wrap; }
    .reference-section-heading .see-all { flex-shrink: 0; }
    .reference-benefits > div:last-child { display: flex; }
    .reference-benefits strong, .reference-benefits small { white-space: normal; }
    .reference-hero-art { height: clamp(190px, 60vw, 285px); }
    .reference-card-top { flex-wrap: wrap; }
    .reference-card-title { flex: 1 1 65px; }
    .reference-small-grid { grid-template-columns: minmax(0, 1fr); }
    .compact-card .reference-card-top { display: flex; flex-wrap: nowrap; }
    .compact-card .reference-card-title h3 { font-size: 13px; }
    .compact-card p, .compact-card .reference-download { font-size: 12px; }
    .compact-card .version-pill { font-size: 11px; }
    .reference-card-description { font-size: 12px; }
    .reference-download { font-size: 12px; }
    .detail-info { width: 100%; }
    .app-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .app-metrics > div { min-width: 0; padding: 0 8px; }
    .store-footer { flex-wrap: wrap; }
    .login-box { padding: 24px 20px; }
    .about-store { padding: 28px 20px; max-height: 90dvh; overflow-y: auto; }
    .screenshot-dialog { max-height: 95dvh; }
    .screenshot-dialog img { max-height: 78dvh; }
    .page-content > .row { --bs-gutter-x: 1.5rem; }
}

@media (max-width: 720px) {
    .admin-sidebar { width: min(280px, 82vw); visibility: hidden; }
    .admin-sidebar.mobile-open { visibility: visible; }
    .sidebar-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 19; border: 0; background: #092a1a88; }
    .admin-topbar { gap: 8px; padding: 0 12px; }
    .header-search { padding: 0 10px; gap: 8px; }
    .menu-toggle, .logout-btn { flex-shrink: 0; min-width: 44px; min-height: 44px; }
    .top-user { display: none; }
    .stat-card { align-items: flex-start; flex-wrap: wrap; }
    .upload-grid, .form-grid, .guide-panel, .workspace-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid > .field { grid-column: 1; }
    .drop-area { height: auto; min-height: 127px; }
    .drop-area span { max-width: 100%; }
    .radio-options label { min-height: 44px; }
    .featured-check input { flex-shrink: 0; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1 1 180px; white-space: normal; }
    .apps-list, .guide-card, .category-panel { padding: 16px; }
    .table-responsive { max-width: 100%; }
    .admin-table { min-width: 760px; }
    .list-filters { flex-wrap: wrap; }
    .list-filters .form-control, .list-filters .form-select { width: 100%; }
    .admin-footer { padding: 24px 0; }
}

@media (max-width: 420px) {
    .reference-brand { white-space: normal; }
    .reference-nav-links { width: 100%; justify-content: space-between; margin: 0; gap: 8px; }
    .reference-nav-links .current, .reference-nav-links > a[href="#categories"],
    .reference-nav-links > button { display: flex; }
    .reference-nav-links .ui-icon { display: none; }
    .reference-nav-links .current:after { bottom: 0; }
    .reference-hero-copy { padding-left: 4px; padding-right: 4px; }
    .reference-app-grid { grid-template-columns: minmax(0, 1fr); }
    .reference-card-top { display: flex; flex-wrap: nowrap; }
    .reference-card-title { margin-top: 0; }
    .reference-card-title h3 { font-size: 15px; }
    .reference-card-description { min-height: 0; }
    .nav-inner { flex-wrap: wrap; gap: 8px; padding-top: 12px; }
    .nav-links { width: 100%; gap: 24px; }
    .nav-links a { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .admin-sidebar { transition: none; }
}
