.software-grid {
  display: flex;
  flex-wrap: wrap;            /* as many icons per row as fit, then continue on the next row */
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.software-card {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .12);
}

.software-summary {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border-radius: 9px;
  cursor: pointer;
}
.software-summary::-webkit-details-marker { display: none; }
.software-summary:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

.app-icon {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background-color: #f8fafc;
}

.app-icon-image {
  position: absolute;
  top: 18px;
  left: 18px;
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.app-name {
  position: absolute;
  right: 3px;
  bottom: 4px;
  left: 3px;
  display: -webkit-box;
  overflow: hidden;
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 3px #000, 0 0 5px rgba(0, 0, 0, .8);
  background: transparent;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.software-icon-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}

.software-popup {
  position: fixed;
  top: var(--software-popup-top, 0);
  left: var(--software-popup-left, 0);
  z-index: 1001;
  display: none;
  box-sizing: border-box;
  width: min(280px, calc(100vw - 12px));
  max-height: calc(100vh - 12px);
  padding: 10px;
  overflow-y: auto;
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(2, 6, 23, .32);
}
.software-card[open] .software-popup { display: block; }
.app-overlay-name { min-height: 36px; margin: 0; padding: 5px 40px 3px 0; font-weight: 800; }
.app-overlay-desc { margin: 2px 0 7px; color: #cbd5e1; font-size: .86rem; line-height: 1.3; }

.software-popup-close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #e2e8f0;
  font: inherit;
  font-size: 1.25rem;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 50%;
  cursor: pointer;
}
.software-popup-close:focus-visible { outline: 2px solid #93c5fd; }

.software-downloads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.software-download {
  display: grid;
  min-height: 42px;
  padding: 2px;
  place-items: center;
  border-radius: 7px;
}
.software-download:hover, .software-download:focus-visible { background: #1e293b; }
.software-download img, .software-download > span { width: 32px; height: 32px; object-fit: contain; }
.software-empty { margin: 0; padding: 6px; color: #64748b; border: 1px dashed #94a3b8; }

.software-search { width: 100%; max-width: 1050px; margin: 6px auto; }
.software-search-toolbar, .software-search-count { margin: 5px 0; }
.software-search-toolbar form { width: 100%; gap: 4px; }
.software-search-toolbar input[type="search"] { flex: 1 1 220px; width: auto; }
.software-search-toolbar select { width: 180px; }
.software-search-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.software-search-results a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; min-height: 48px; padding: 6px; color: #0f172a; text-decoration: none; border: 1px solid #e2e8f0; border-radius: 8px; }
.software-search-results strong { padding: 2px 5px; color: #2563eb; font-size: .72rem; background: #eff6ff; border-radius: 999px; }
.software-search-results span:not(.software-result-download) { min-width: 0; overflow-wrap: anywhere; }
.software-result-download { color: #2563eb; font-size: 1.1rem; }

@media (max-width: 600px) {
  .software-grid { gap: 6px; }
  .software-card, .software-summary { flex-basis: 96px; width: 96px; height: 96px; }
  .app-icon-image { top: 16px; left: 16px; width: 64px; height: 64px; }
  .app-name { font-size: .68rem; }
  .software-popup { width: min(272px, calc(100vw - 8px)); max-height: calc(100vh - 8px); padding: 8px; }
  .software-popup-close { width: 40px; height: 40px; top: 4px; right: 4px; }
  .app-overlay-name { min-height: 40px; padding-right: 44px; }
  .software-download { min-height: 44px; padding: 0; }
  .software-search-toolbar form { display: grid; gap: 3px; }
  .software-search-toolbar input[type="search"], .software-search-toolbar select { width: 100%; min-height: 42px; }
  .software-search-results { grid-template-columns: 1fr; }
}

.software-search-popup { width: min(340px, calc(100vw - 12px)); }
.software-search-form { display: grid; gap: 4px; margin: 6px 0; }
.software-search-form input, .software-search-form select { box-sizing: border-box; width: 100%; min-height: 36px; padding: 4px 8px; border-radius: 6px; border: 1px solid #475569; }
.software-search-popup .software-search-results { max-height: 40vh; overflow-y: auto; grid-template-columns: 1fr; }
.software-search-popup .software-search-results a { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.software-search-popup .software-search-results li { color: #cbd5e1; }

.software-more-link { margin: 8px 0 0; font-size: .86rem; }
.software-more-link a { color: #93c5fd; }
.software-search-page { max-width: 560px; margin-bottom: 16px; }
.software-search-page .software-search-form input, .software-search-page .software-search-form select { box-sizing: border-box; width: 100%; min-height: 40px; padding: 4px 8px; border-radius: 6px; border: 1px solid #cbd5e1; }

.software-search-link { display: block; text-decoration: none; color: inherit; }
.software-search-link:hover .software-summary { filter: brightness(.97); }

.apps-share { margin: 24px 0; }
.apps-share__qr { display: inline-block; padding: 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }
.apps-share__qr img, .apps-share__qr canvas { display: block; }
.apps-share__link input { width: min(420px, 100%); box-sizing: border-box; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; }
.apps-share__link button { padding: 6px 12px; border-radius: 6px; border: 1px solid #2563eb; background: #2563eb; color: #fff; cursor: pointer; }

/* the plain "Download" link under the platform badges of an app card */
.software-get-row { margin: 10px 0 0; text-align: center; }
.software-get { display: inline-block; padding: 8px 18px; border-radius: 999px; background: var(--primary, #2563eb); color: #fff; font-weight: 600; text-decoration: none; }
.software-get:hover { filter: brightness(1.1); }

/* the /apps page: the title with the site's share button beside it, one search line (the shared search box + a narrow platform menu) */
.apps-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.apps-head h1 { margin: 0; }
.apps-head .apps-share-btn { width: 40px; height: 40px; min-width: 40px; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid #e5e7eb; background: linear-gradient(145deg, #ffffff 0%, #f5f5f5 70%); color: #111827; font-size: 1.1rem; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .04), 0 4px 10px rgba(0, 0, 0, .04); transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease; }
.apps-head .apps-share-btn:hover { border-color: #d1d5db; box-shadow: 0 0 0 3px rgba(17, 24, 39, .06); transform: translateY(-1px); }
.software-search-page { max-width: 560px; }
.software-search-page .software-search-form { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; margin: 6px 0; }
.software-search-page .software-search-form .search-box { flex: 1 1 auto; width: auto; min-width: 0; height: 40px; }
.software-search-page .software-search-form .search-box input[type="search"] { width: auto; flex: 1 1 auto; min-width: 0; min-height: 0; height: 100%; padding: 0 12px; border: 0; border-radius: 0; background: transparent; }
.software-search-page .software-search-form .search-box .icon-btn { min-height: auto; padding: 0 10px; }
.software-search-page .software-search-form select.software-platform-select {
  flex: 0 0 auto; width: 140px; min-height: 40px; height: 40px; padding: 0 30px 0 12px; border-radius: 12px; border: 1px solid #e5e7eb; color: #111827; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center, linear-gradient(145deg, #ffffff 0%, #f5f5f5 70%);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .04), 0 4px 10px rgba(0, 0, 0, .04);
}
.software-search-page .software-search-form select.software-platform-select:hover { border-color: #d1d5db; box-shadow: 0 0 0 3px rgba(17, 24, 39, .06); }
.software-search-page .software-search-form select.software-platform-select:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }
@media (max-width: 480px) { .software-search-page .software-search-form select.software-platform-select { width: 104px; padding-left: 10px; } }

/* the /apps page: the MeWe web services under the recommended apps */
.web-services { margin: 28px 0 8px; }
.web-services__hint { margin: -4px 0 12px; color: #6b7280; }
.web-services__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.web-service { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; color: #111827; text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .04); transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease; }
.web-service:hover { border-color: #cbd5e1; box-shadow: 0 6px 16px rgba(0, 0, 0, .08); transform: translateY(-1px); text-decoration: none; }
.web-service strong { font-size: 1.02rem; }
.web-service span { font-size: .92rem; color: #374151; }
.web-service small { margin-top: auto; padding-top: 6px; color: #6b7280; }
