:root {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #fff;
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --accent: #0066cc;
  --tint: #edf4ff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --secondary: #a1a1a6;
    --accent: #80b8ff;
    --tint: #142b47;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(64px + env(safe-area-inset-top))
           calc(20px + env(safe-area-inset-right))
           calc(32px + env(safe-area-inset-bottom))
           calc(20px + env(safe-area-inset-left));
  background: var(--bg);
  color: var(--text);
}

main {
  max-width: 560px;
  margin: 0 auto;
}

header { margin-bottom: 28px; }

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

.hint, .status {
  margin: 12px 0 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.6;
}

.apps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app {
  display: grid;
  grid-template-columns: 57px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
}

.icon {
  display: grid;
  place-items: center;
  width: 57px;
  height: 57px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--bg);
  color: var(--secondary);
  font-size: 24px;
  font-weight: 600;
}

.icon img { object-fit: cover; }
.details { min-width: 0; }

.name {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.version {
  margin: 5px 0 0;
  color: var(--secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  background: var(--tint);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.install:active { opacity: .7; }
.install:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (max-width: 380px) {
  .app { gap: 12px; padding: 16px; }
  .install { padding: 0 14px; }
}
