/* ============================================================
   topdevphone — App Store
   Everything below is scoped to .as-* so it cannot leak into
   another app. Colours come from the shared CSS variables only,
   so both the dark and the light theme stay correct; the only
   fixed colours are inside the gradient artwork, which sits on
   its own coloured surface in either theme.
   ============================================================ */

/* ---------- shared bits ---------- */
.as-label { margin-top: 18px; }
.as-mt { margin-top: 10px; }

.as-tile {
  position: relative;
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--tile-ink, #f8fbff);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}
.as-tile .ic { position: relative; z-index: 1; width: 25px; height: 25px; }
.as-tile-shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, calc(var(--icon-sheen, 0.28))),
    rgba(255, 255, 255, calc(var(--icon-sheen, 0.28) * 0.12)) 44%, transparent 48%);
}
.as-tile-sm { width: 34px; height: 34px; border-radius: 9px; }
.as-tile-sm .ic { width: 19px; height: 19px; }
.as-tile-lg { width: 68px; height: 68px; border-radius: 16px; }
.as-tile-lg .ic { width: 36px; height: 36px; }

/* ---------- GET / OPEN button ---------- */
.as-get {
  min-width: 58px; padding: 6px 12px; border-radius: 15px;
  background: var(--bg-tertiary); color: var(--accent-blue);
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.6px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.12s, filter 0.15s;
}
.as-get:active:not(:disabled) { transform: scale(0.94); filter: brightness(1.15); }
.as-get-open { color: var(--text-primary); }
.as-get-off {
  color: var(--text-tertiary); opacity: 0.7; cursor: default;
  min-width: 0; padding: 6px 11px; font-size: 11px; letter-spacing: 0.3px;
}
.as-get-busy { color: var(--text-secondary); }
.as-get-busy .wz-spinner { width: 13px; height: 13px; border-width: 2px; }
.as-get-lg {
  background: rgba(255, 255, 255, 0.92); color: #101014;
  min-width: 74px; padding: 8px 16px; border-radius: 17px;
}
.as-get-lg.as-get-off { background: rgba(255, 255, 255, 0.4); color: rgba(16, 16, 20, 0.55); }
.as-get-lg.as-get-busy { color: rgba(16, 16, 20, 0.7); }

/* ---------- featured hero ---------- */
.as-hero { margin-top: 4px; }
.as-hero-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-card-lg);
  padding: 18px 18px 14px; color: #fff;
  min-height: 176px;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  animation: asHeroIn 0.5s cubic-bezier(0.32, 0.72, 0.35, 1);
}
@keyframes asHeroIn { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.as-hero-glow {
  position: absolute; inset: -30% -10% auto -30%; height: 150%;
  background: radial-gradient(60% 55% at 20% 12%, rgba(255, 255, 255, 0.42), transparent 62%),
              radial-gradient(50% 45% at 92% 88%, rgba(0, 0, 0, 0.3), transparent 60%);
  pointer-events: none;
}
.as-hero-kicker {
  position: relative; font-size: 10.5px; font-weight: 800;
  letter-spacing: 1.6px; text-transform: uppercase; opacity: 0.82;
}
.as-hero-name {
  position: relative; font-size: 27px; font-weight: 800;
  letter-spacing: -0.4px; margin-top: 6px; line-height: 1.1;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.22);
}
.as-hero-tag {
  position: relative; font-size: 13.5px; opacity: 0.88; margin-top: 4px;
  max-width: 84%; line-height: 1.35;
}
.as-hero-foot {
  position: relative; margin-top: auto; padding-top: 16px;
  display: flex; align-items: center; gap: 10px;
}
.as-hero-open {
  display: flex; align-items: center; gap: 9px; color: #fff;
  font-size: 12.5px; font-weight: 700; flex: 1; min-width: 0; text-align: left;
}
.as-hero-open span { opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-hero-open:active { opacity: 0.75; }
.as-hero-dots {
  position: absolute; right: 16px; top: 18px; display: flex; gap: 5px;
}
.as-hero-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.45); transition: background 0.25s, width 0.25s;
}
.as-hero-dots i.on { width: 14px; border-radius: 3px; background: rgba(255, 255, 255, 0.95); }

/* ---------- app rows ---------- */
.as-list {
  background: var(--bg-secondary); border-radius: var(--radius-card);
  overflow: hidden; margin-bottom: 8px;
}
.as-row {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 11px 10px 11px 12px;
}
.as-row + .as-row::before {
  content: ''; position: absolute; top: 0; left: 66px; right: 0;
  height: 1px; background: var(--separator);
}
.as-row-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px;
  color: inherit; text-align: left; padding: 0;
}
.as-row-main:active { opacity: 0.65; }
.as-row-text { min-width: 0; display: block; }
.as-row-name {
  display: block; font-size: 15px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.as-row-sub {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-size: 12px; line-height: 1.3; color: var(--text-secondary);
  margin-top: 2px; overflow: hidden;
}
.as-row-sub.as-row-off { color: var(--accent-orange); }
.as-row-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.as-more {
  width: 26px; height: 30px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 17px;
}
.as-more .ic { width: 19px; height: 19px; }
.as-more:active { background: var(--bg-tertiary); }

.as-foot {
  font-size: 11.5px; color: var(--text-tertiary); line-height: 1.45;
  padding: 4px 6px 10px; text-align: center;
}

/* ---------- search ---------- */
.as-search {
  position: relative; display: flex; align-items: center; margin: 6px 0 14px;
  color: var(--text-tertiary);
}
.as-search > .ic {
  position: absolute; left: 11px; width: 17px; height: 17px; pointer-events: none;
}
.as-search-input { padding-left: 34px; }

/* ---------- unreachable state ---------- */
.as-down {
  text-align: center; padding: 54px 24px 20px;
  display: flex; flex-direction: column; align-items: center;
}
.as-down-mark {
  width: 74px; height: 74px; border-radius: 22px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); color: var(--text-tertiary);
  box-shadow: inset 0 0 0 1px var(--separator);
}
.as-down-mark .ic { width: 36px; height: 36px; }
.as-down-title { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.as-down-text {
  font-size: 13px; color: var(--text-secondary); line-height: 1.5;
  margin-top: 7px; max-width: 260px;
}
.as-down-retry { margin-top: 20px; max-width: 200px; }

/* ---------- sheets (⋯ menu + detail) ---------- */
.as-sheet-host { position: absolute; inset: 0; z-index: 100; display: none; }
.as-sheet-host.show { display: block; }
.as-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.as-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg-elevated); color: var(--text-primary);
  border-radius: 22px 22px 0 0; padding: 18px 18px 26px;
  max-height: 88%; overflow-y: auto;
  animation: asSheetUp 0.28s cubic-bezier(0.32, 0.72, 0.35, 1);
}
.as-sheet::-webkit-scrollbar { width: 0; }
@keyframes asSheetUp { from { transform: translateY(60%); } }

.as-menu-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.as-menu-name { font-size: 16px; font-weight: 800; }
.as-menu-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.as-menu-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: 13px; margin-bottom: 8px;
  background: var(--bg-tertiary); color: var(--text-primary);
  font-size: 14.5px; font-weight: 600; text-align: left;
}
.as-menu-item .ic { width: 19px; height: 19px; color: var(--text-secondary); }
.as-menu-item:active:not(:disabled) { filter: brightness(1.2); }
.as-menu-item.danger, .as-menu-item.danger .ic { color: var(--accent-red); }
.as-menu-item:disabled { opacity: 0.38; cursor: default; }
.as-menu-note {
  font-size: 11.5px; color: var(--text-tertiary);
  line-height: 1.45; margin: 2px 4px 8px; text-align: center;
}

.as-sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary); color: var(--text-secondary);
}
.as-sheet-close .ic { width: 15px; height: 15px; }

.as-detail-head { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.as-detail-name { font-size: 21px; font-weight: 800; letter-spacing: -0.2px; }
.as-detail-tag { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.as-detail-meta {
  font-size: 11px; color: var(--text-tertiary); margin-top: 6px;
  text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700;
}
.as-detail-off {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; padding: 10px; border-radius: 12px;
  background: rgba(255, 149, 0, 0.13); color: var(--accent-orange);
  font-size: 12.5px; font-weight: 700;
}
.as-detail-off .ic { width: 17px; height: 17px; }
.as-desc { font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.as-points { list-style: none; margin: 12px 0 4px; }
.as-points li {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-primary); padding: 5px 0;
}
.as-points .ic { width: 15px; height: 15px; color: var(--accent-green); flex: 0 0 auto; }

/* ---------- CSS-only "screenshots" ---------- */
.as-shots {
  display: flex; gap: 10px; margin: 16px -18px 0; padding: 0 18px 6px;
  overflow-x: auto; scroll-snap-type: x mandatory;
}
.as-shots::-webkit-scrollbar { height: 0; }
.as-shot {
  position: relative; flex: 0 0 auto; scroll-snap-align: start;
  width: 116px; height: 208px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.as-shot::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 50% at 20% 0%, rgba(255, 255, 255, 0.34), transparent 62%);
}
.as-shot-inner {
  position: absolute; inset: 12px 10px;
  display: flex; flex-direction: column; flex-wrap: wrap;
  align-content: flex-start; gap: 7px;
}
.as-shot-inner i {
  display: block; border-radius: 5px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.as-shot-inner .s-bar { width: 100%; height: 16px; border-radius: 8px; background: rgba(255, 255, 255, 0.6); }
.as-shot-inner .s-row { width: 100%; height: 34px; }
.as-shot-inner .s-row.short { width: 62%; }
.as-shot-inner .s-hero { width: 100%; height: 92px; border-radius: 10px; background: rgba(255, 255, 255, 0.55); }
.as-shot-inner .s-grid { width: calc(50% - 4px); height: 52px; border-radius: 8px; }
.as-shot-1 .as-shot-inner { flex-direction: row; flex-wrap: wrap; }
.as-shot-1 .as-shot-inner .s-bar { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .as-hero-card, .as-sheet { animation: none !important; }
}
