:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: rgba(255, 255, 255, 0.78);
  --text: #172033;
  --muted: #7b8496;
  --line: #dce3ee;
  --accent: #3268e8;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #f8faff 0, var(--bg) 220px); color: var(--text); -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.launcher {
  width: min(620px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(36px + env(safe-area-inset-bottom));
}

.header { margin-bottom: 24px; }
h1 { margin: 0; font-size: 0.96rem; font-weight: 750; letter-spacing: 0.01em; }

.section + .section { margin-top: 34px; }
h2 { margin: 0 0 20px; font-size: 0.78rem; font-weight: 750; color: #596276; }
.app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 14px; }
.app-item { min-width: 0; text-align: center; }
.icon-wrap { position: relative; width: 100%; }
.app-link { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; color: inherit; text-decoration: none; }
.app-icon { display: grid; place-items: center; width: clamp(62px, 18vw, 76px); aspect-ratio: 1; border: 1px solid rgba(255, 255, 255, 0.82); border-radius: 20px; background: var(--icon-bg); color: var(--icon-color); box-shadow: 0 7px 16px rgba(30, 46, 76, 0.1), inset 0 1px rgba(255, 255, 255, 0.5); font-size: clamp(1rem, 4.5vw, 1.25rem); font-weight: 850; letter-spacing: -0.05em; transition: transform 120ms ease, filter 120ms ease; }
.app-icon-image { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.app-link:active .app-icon { transform: scale(0.94); filter: brightness(0.97); }
.app-link:focus-visible { outline: 0; }
.app-link:focus-visible .app-icon { outline: 3px solid rgba(50, 104, 232, 0.32); outline-offset: 3px; }
.app-name { display: -webkit-box; width: 100%; min-height: 2.5em; overflow: hidden; color: #30394b; font-size: clamp(0.68rem, 2.8vw, 0.78rem); font-weight: 650; line-height: 1.25; text-align: center; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pin-button { position: absolute; top: -6px; right: calc(50% - clamp(39px, 11vw, 47px)); z-index: 2; display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 2px solid var(--bg); border-radius: 50%; background: #fff; color: #8b95a8; box-shadow: 0 2px 7px rgba(34, 48, 72, 0.16); cursor: pointer; }
.pin-button::before { content: "+"; font-size: 1rem; font-weight: 800; line-height: 1; }
.pin-button.is-pinned { background: var(--accent); color: #fff; }
.pin-button.is-pinned::before { content: "✓"; font-size: 0.78rem; }
.empty { grid-column: 1 / -1; margin: -2px 0 0; padding: 22px 0; color: var(--muted); font-size: 0.78rem; text-align: center; }

@media (min-width: 520px) {
  .launcher { padding-inline: 30px; }
  .app-grid { gap: 28px 22px; }
}

@media (max-width: 350px) {
  .launcher { padding-inline: 12px; }
  .app-grid { gap-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
