:root {
  --bg: #f3f5f8;
  --bg-soft: #ffffff;
  --text: #141a24;
  --muted: #5f6b7d;
  --primary: #1f2937;
  --primary-soft: #eef2f7;
  --stroke: #dce3ee;
  --shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
  --gold-link: #b68a2e;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top right, #f8fafc, #f3f5f8 45%, #edf1f6);
  color: var(--text);
}

.app {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 16px 14px 98px;
}

.hero {
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--stroke);
  border-radius: 0;
  padding: 10px 16px 12px;
  box-shadow: none;
  margin: -16px -14px 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.logo__mark {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px 0;
  color: #667487;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none;
  white-space: nowrap;
}

.logo__mark::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 9px;
  border-radius: 999px;
  background: var(--gold-link);
  box-shadow: 0 0 0 4px rgba(182, 138, 46, 0.14);
}

.logo__go {
  color: #1f2a3a;
  font-weight: 800;
}

.logo__suffix {
  color: #5d6b7f;
  opacity: 0.72;
}

.controls {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 10px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 26px rgba(20, 28, 40, 0.16);
}

.filter-btn {
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: #374151;
  border-radius: 10px;
  padding: 11px 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #f8fafc;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.external-block {
  margin-top: 16px;
}

.section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3f4c60;
}

.install-prompt {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 84px;
  z-index: 11;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.16);
  padding: 10px 12px;
}

.install-prompt__text {
  font-size: 13px;
  line-height: 1.35;
  color: #405067;
  margin-bottom: 8px;
}

.install-prompt__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.install-btn {
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.install-btn--primary {
  border: 1px solid #1f2937;
  background: #1f2937;
  color: #f8fafc;
}

.install-btn--ghost {
  border: 1px solid #d1d9e6;
  background: #ffffff;
  color: #324054;
}

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  text-decoration: none;
  background: var(--bg-soft);
  color: inherit;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:active {
  transform: scale(0.99);
}

.card__icon-wrap {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  background: linear-gradient(135deg, #f8fbff, #edf2f9);
  display: grid;
  place-items: center;
  position: relative;
}

.card__icon {
  width: 100%;
  height: 100%;
}

.card__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #475569;
  font-size: 14px;
}

.card__content {
  min-width: 0;
}

.card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.card__desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.card__url {
  margin-top: 6px;
  font-size: 12px;
  color: var(--gold-link);
  opacity: 0.9;
}

.empty-state {
  margin: 28px 0 0;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none;
}

@media (min-width: 640px) {
  .app {
    padding: 24px 18px 56px;
  }

  .hero {
    margin: -24px -18px 8px;
    padding: 12px 22px 14px;
  }

  .controls {
    position: sticky;
    inset: auto;
    top: 10px;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 14px 0;
    box-shadow: none;
  }

  .install-prompt {
    left: auto;
    right: 18px;
    bottom: 18px;
    width: min(360px, calc(100vw - 36px));
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(20, 30, 48, 0.14);
  }
}

@media (min-width: 930px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
