/* ==========================================================================
   Aevy Apps page: Play Store style storefront + "My apps" library manager
   ========================================================================== */
.apps { padding-top: 22px; padding-bottom: 110px; }

/* top bar: search + tabs */
.ap-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ap-search {
  flex: 1 1 320px; max-width: 560px; display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 18px;
  border-radius: 999px; background: var(--surface2); border: 1px solid transparent;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.ap-search:focus-within { background: var(--surface); border-color: var(--accent-hi); box-shadow: 0 0 0 4px var(--accent-soft); }
.ap-search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.ap-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 15px; }
.ap-search input::placeholder { color: var(--muted); }
.ap-search input::-webkit-search-cancel-button { display: none; }

.ap-up { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--accent-text); border: 1px solid var(--line2); transition: all .18s var(--ease); white-space: nowrap; }
.ap-up:hover { background: var(--accent-soft); border-color: transparent; }
.ap-tabs { display: flex; gap: 4px; margin-left: auto; }
.ap-tabs button {
  position: relative; height: 48px; padding: 0 16px; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 550; color: var(--muted); transition: color .2s var(--ease);
}
.ap-tabs button:hover { color: var(--text); }
.ap-tabs button.on { color: var(--accent-text); }
.ap-tabs button::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--accent-hi); transform: scaleX(0); transition: transform .25s var(--ease);
}
.ap-tabs button.on::after { transform: scaleX(1); }

/* chips */
.ap-chips, .ap-sub { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 6px; scrollbar-width: none; }
.ap-chips::-webkit-scrollbar, .ap-sub::-webkit-scrollbar { display: none; }
.ap-chip {
  flex: none; height: 34px; padding: 0 16px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--text2); background: transparent; border: 1px solid var(--line2); transition: all .18s var(--ease);
}
.ap-chip:hover { background: var(--surface2); color: var(--text); }
.ap-chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); font-weight: 600; }
#apBody, #apMine { padding-top: 10px; }

/* app icon (squircle tile in the language colour) */
.ap-ic {
  --s: 56px; container-type: inline-size; position: relative; flex: none; display: grid; place-items: center;
  width: var(--s); height: var(--s); border-radius: 23%; overflow: hidden; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 88%, #fff), color-mix(in srgb, var(--c) 72%, #000));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.ap-ic::before { content: ""; position: absolute; inset: 0 0 50%; background: linear-gradient(rgba(255, 255, 255, .22), transparent); }
.ap-ic b { position: relative; font-family: var(--mono); font-weight: 700; font-size: 30cqw; letter-spacing: -.04em; text-transform: lowercase; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.ap-ic.l4 b { font-size: 23cqw; }
.ap-ic.l5 b { font-size: 18cqw; }
.ap-ic.xl { --s: 116px; }

/* hero */
.ap-hero {
  margin-top: 14px; border-radius: 28px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c) 55%, #fff) 0%, transparent 55%),
              linear-gradient(135deg, color-mix(in srgb, var(--c) 80%, #000), color-mix(in srgb, var(--c) 35%, #0b0b14));
}
.ap-hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.ap-hero-in { position: relative; z-index: 1; display: flex; align-items: center; gap: 30px; padding: clamp(24px, 4vw, 44px); }
.ap-hero .ap-ic { box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .25); }
.ap-hero-t { min-width: 0; }
.ap-kick { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.ap-hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 700; letter-spacing: -.04em; line-height: 1.1; margin: 6px 0 8px; overflow-wrap: anywhere; }
.ap-hero p { max-width: 38em; opacity: .88; font-size: 15px; line-height: 1.5; }
.ap-hero-m { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 13px; opacity: .92; }
.ap-hero-m .ap-rt, .ap-hero-m .ap-rt.new { color: #fff; }
.ap-hero-b { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.ap-hero .ap-get { background: #fff; color: #10131c; }
.ap-hero .ap-get:hover { background: #eef2ff; }
.ap-hero .ap-ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
.ap-hero .ap-ghost:hover { background: rgba(255, 255, 255, .14); }

/* buttons */
.ap-get, .ap-ghost, .ap-del {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 20px; border-radius: 999px;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .18s var(--ease); white-space: nowrap;
}
.ap-get { background: var(--accent); color: var(--accent-ink); border: 0; }
.ap-get:hover { background: var(--accent-hi); transform: translateY(-1px); }
.ap-get:active { transform: none; }
.ap-get.big, .ap-ghost.big { height: 44px; padding: 0 30px; font-size: 14.5px; }
.ap-hero-b .ap-get, .ap-hero-b .ap-ghost { height: 44px; padding: 0 28px; font-size: 14.5px; }
.ap-ghost { background: transparent; color: var(--accent-text); border: 1px solid var(--line2); }
.ap-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.ap-del { width: 36px; padding: 0; background: transparent; color: var(--muted); border: 1px solid var(--line2); }
.ap-del:hover { color: #ff6b6b; border-color: #ff6b6b66; background: rgba(255, 107, 107, .1); }

/* shelves */
.ap-shelf { margin-top: 34px; }
.ap-shelf > header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ap-shelf h2 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.ap-shelf header p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ap-more { margin-left: auto; background: none; border: 0; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent-text); padding: 6px 10px; border-radius: 999px; }
.ap-more:hover { background: var(--accent-soft); }
.ap-nav { display: flex; gap: 6px; margin-left: auto; }
.ap-more + .ap-nav { margin-left: 0; }
.ap-nav button {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; padding: 0 0 2px; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text2); background: var(--surface2); border: 1px solid var(--line); transition: all .18s var(--ease);
}
.ap-nav button:hover { background: var(--surface3); color: var(--text); }
.ap-row { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 14px; margin: 0 -2px; scrollbar-width: none; }
.ap-row::-webkit-scrollbar { display: none; }
.ap-card {
  flex: none; width: 138px; display: flex; flex-direction: column; gap: 3px; padding: 8px; margin: -8px 0; border-radius: 18px; cursor: pointer;
  scroll-snap-align: start; transition: background .18s var(--ease), transform .25s var(--ease);
}
.ap-card:hover { background: var(--surface2); transform: translateY(-3px); }
.ap-card .ap-ic { --s: 100%; width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 8px; }
.ap-t { font-size: 14px; font-weight: 550; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ap-s { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-m { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ap-rt { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--text2); }
.ap-rt svg { color: #f5b301; }
.ap-rt.new { color: var(--accent-text); }

/* result / chart rows */
.ap-rows { display: flex; flex-direction: column; margin-top: 8px; }
.ap-res { display: flex; align-items: center; gap: 16px; padding: 12px 14px; margin: 0 -14px; border-radius: 18px; cursor: pointer; transition: background .18s var(--ease); }
.ap-res:hover { background: var(--surface2); }
.ap-rank { width: 26px; text-align: center; font-size: 17px; font-weight: 600; color: var(--muted); flex: none; }
.ap-rmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-rmain b { font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-count { margin-top: 14px; color: var(--muted); font-size: 13.5px; }

/* My apps */
.ap-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 10px; }
.ap-stat { padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.ap-stat b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -.03em; }
.ap-stat span { font-size: 12.5px; color: var(--muted); }
.ap-list { border: 0; background: transparent; border-radius: 0; overflow: visible; margin-top: 4px; }
.ap-lhead { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.ap-lhead label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text2); }
.ap-lhead input, .ap-ck input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.ap-mrow { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); border-radius: 0; transition: background .18s var(--ease); }
.ap-mrow:hover { background: var(--surface2); }
.ap-mrow .ap-rmain { cursor: pointer; }
.ap-mrow .ap-s { white-space: normal; }
.ap-ck { display: grid; place-items: center; padding: 0 2px; }
.ap-macts { display: flex; gap: 8px; align-items: center; flex: none; }
.ap-vis { padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.ap-vis.pub { background: rgba(60, 190, 110, .14); color: #3bbd6e; }
.ap-vis.priv { background: rgba(255, 170, 40, .14); color: #e59a1e; }
.ap-empty { text-align: center; padding: 70px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ap-empty-ic { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 8px; }
.ap-empty h3 { font-size: 18px; font-weight: 650; }
.ap-empty p { color: var(--muted); max-width: 28em; margin-bottom: 10px; }

@media (max-width: 760px) {
  .apps { padding-top: 12px; }
  .ap-top { gap: 8px; }
  .ap-search { flex-basis: 100%; max-width: none; height: 44px; }
  .ap-up { display: none; }
  .ap-tabs { margin: 0; width: 100%; border-bottom: 1px solid var(--line); }
  .ap-tabs button { flex: 1; padding: 0 6px; height: 44px; }
  .ap-chips { padding-top: 14px; }
  .ap-hero { border-radius: 22px; }
  .ap-hero-in { flex-direction: column; align-items: flex-start; gap: 18px; }
  .ap-hero .ap-ic.xl { --s: 84px; }
  .ap-nav { display: none; }
  .ap-more { margin-left: auto; }
  .ap-shelf { margin-top: 26px; }
  .ap-row { margin: 0 -14px; padding-inline: 14px; scroll-padding-inline: 14px; }
  .ap-card { width: 118px; }
  .ap-stats { grid-template-columns: repeat(2, 1fr); }
  .ap-res { gap: 12px; }
  .ap-mrow { flex-wrap: wrap; }
  .ap-mrow .ap-rmain { flex-basis: calc(100% - 120px); }
  .ap-macts { flex-basis: 100%; }
  .ap-macts .ap-get { flex: 1; }
  .ap-macts .ap-ghost { flex: 1; }
}
@media (hover: none) { .ap-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .ap-card, .ap-get, .ap-tabs button::after { transition: none; } }
