/* Shared navigation and compact catalogue. Native dialogs retain keyboard handling. */
.site-menu-toggle[hidden] { display: none !important; }
.has-site-menu .header [data-legacy-nav] { display: none !important; }
.has-site-menu .header .header-inner { flex-wrap: nowrap; justify-content: space-between; gap: 16px; }
.has-site-menu .header .brand { width: auto !important; flex: 1; min-width: 0; }
.site-menu-toggle { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 48px; min-height: 48px; padding: 10px 14px; border: 1px solid #ffffff70; border-radius: 10px; color: #fff; background: #ffffff0c; font: 700 14px Montserrat, sans-serif; cursor: pointer; margin-left: auto; }
.site-menu-toggle:hover { background: #ffffff20; }
.site-menu-bars { display: grid; gap: 5px; width: 23px; }
.site-menu-bars span { display: block; height: 2px; border-radius: 2px; background: currentColor; }
.site-menu-utility { display: flex; justify-content: flex-end; padding: 12px max(16px, calc((100vw - 1100px)/2)); background: #123f36; }
.site-menu-dialog, .app-detail-dialog { box-sizing: border-box; color: #143c34; background: #fff; border: 1px solid #d6e5df; border-radius: 16px; padding: 0; box-shadow: 0 18px 70px #071e3150; font-family: Montserrat, sans-serif; overscroll-behavior: contain; }
.site-menu-dialog::backdrop, .app-detail-dialog::backdrop { background: #071e31a6; }
.site-menu-dialog { position: fixed; inset: 16px 16px auto auto; margin: 0; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
.site-menu-heading, .app-detail-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: #fff; border-bottom: 1px solid #dce8e2; }
.site-menu-heading h2, .app-detail-heading p { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.4; }
.site-menu-close, .app-detail-close { min-height: 44px; padding: 8px 12px; border: 1px solid #b8cfc5; border-radius: 8px; background: #edf5f0; color: #143c34; font: 700 13px Montserrat, sans-serif; cursor: pointer; flex: none; }
.site-menu-close span, .app-detail-close span { font-size: 22px; margin-left: 5px; vertical-align: -1px; }
.site-menu-dialog .site-menu-links { display: grid; gap: 2px; padding: 12px; }
.site-menu-links p { margin: 8px 12px 5px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #517267; }
.site-menu-links a { display: flex; align-items: center; box-sizing: border-box; min-height: 46px; padding: 11px 12px; border-radius: 8px; color: #143c34; text-decoration: none; font-size: 15px; font-weight: 650; line-height: 1.45; }
.site-menu-links a:hover { background: #e9f5ef; }
.site-menu-links hr { width: 100%; margin: 10px 0; border: 0; border-top: 1px solid #dce8e2; }
.site-menu-toggle:focus-visible, .site-menu-links a:focus-visible, .site-menu-close:focus-visible, .app-detail-close:focus-visible, .compact-app-link:focus-visible { outline: 3px solid #d6ae55; outline-offset: 3px; }
body:has(#site-menu[open]), body:has(#app-details[open]) { overflow: hidden; }
.featured-grid, .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: 16px; }
.compact-app { min-width: 0; border: 1px solid #d7e5df; border-radius: 14px; background: white; overflow: hidden; box-shadow: 0 3px 12px #163d3406; }
.compact-app:hover { border-color: #71a28e; box-shadow: 0 5px 18px #163d3412; }
.compact-available { border-color: #b1d6c1; }
.compact-app.is-new-app { border-color: #d1ac49; background: linear-gradient(120deg, #fffaf0, #ffffff 78%); box-shadow: 0 3px 14px #ac832012; }
.compact-app.is-new-app:hover { border-color: #ab8223; }
.app-announcement { margin: 0 0 12px; }
.app-new-badge { display: inline-block; padding: 5px 10px; border-radius: 6px; background: #f4c64d; color: #173f32; font-size: 11px; line-height: 1.3; font-weight: 850; letter-spacing: .06em; }
.app-new-notice { display: block; margin-top: 7px; color: #205943; font-size: 14px; line-height: 1.45; font-weight: 750; }
.app-card > .app-announcement { margin-top: 16px; }
.compact-app-link { box-sizing: border-box; height: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) 14px; align-items: start; gap: 14px; padding: 18px; color: #143c34; text-decoration: none; }
.compact-icon { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; background: #edf5f1; overflow: hidden; }
.compact-icon > img { width: 100%; height: 100%; object-fit: contain; }
.compact-icon > .compact-overlay { position: absolute; right: 1px; bottom: 1px; width: 24px; height: 35px; object-fit: contain; }
.compact-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.compact-copy { min-width: 0; }
.compact-copy h2, .compact-copy h3 { margin: 4px 0 7px; color: #143c34; font-size: 19px; line-height: 1.3; font-weight: 800; overflow-wrap: anywhere; }
.compact-state { display: block; color: #547264; font-size: 11px; line-height: 1.4; font-weight: 800; }
.compact-available .compact-state { color: #087c39; }
.compact-description { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; color: #486359; font-size: 14px; line-height: 1.6; font-weight: 500; }
.compact-arrow { align-self: center; color: #2c8260; font-size: 30px; line-height: 1; }
.compact-intro { color: #486359; line-height: 1.6; font-weight: 500; }
.app-detail-dialog { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
.app-detail-dialog #app-details-body .app-card { border: 0; border-radius: 0; box-shadow: none; padding: 24px; width: auto; max-width: none; }
.app-detail-dialog .download-primary { opacity: 1; visibility: visible; transform: none; }
.app-detail-dialog .meta, .app-detail-dialog .audience { flex-wrap: wrap; }
.app-detail-dialog a { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .has-site-menu .header .header-inner { gap: 10px; padding-block: 12px; min-height: 90px; }
  .has-site-menu .header .brand-text { font-size: 15px; max-width: none; }
  .has-site-menu .header .brand-author { font-size: 10px; max-width: 220px; }
  .site-menu-toggle { padding: 10px; }
  .site-menu-label { display: none; }
  .featured-grid, .app-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .compact-app-link { grid-template-columns: 50px minmax(0, 1fr) 12px; padding: 15px; gap: 12px; }
  .compact-icon { width: 50px; height: 50px; }
  .compact-copy h2, .compact-copy h3 { font-size: 17px; }
  .compact-description { font-size: 13px; line-height: 1.55; }
  .app-detail-dialog #app-details-body .app-card { padding: 18px; }
  .app-detail-heading { padding: 10px 14px; }
  .app-detail-heading p { font-size: 14px; }
}
