:root {
  color-scheme: light dark;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --ease: 0.15s ease;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: #64748b;
  --accent-fallback: #0284c7;
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070b14;
    --surface: #111827;
    --surface-hover: #152033;
    --border: rgba(148, 163, 184, 0.14);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent-fallback: #38bdf8;
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 28px rgba(0, 0, 0, 0.22);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: min(100%, 28rem);
  margin: 0 auto;
  padding: max(1.25rem, var(--safe-top)) 1.1rem calc(1.5rem + var(--safe-bottom));
}

.header {
  margin-bottom: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.72rem;
  color: #fff;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand strong {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.apps {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.app {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.app:hover {
  background: var(--surface-hover);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

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

.app:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-icon {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  flex-shrink: 0;
}

.app-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-meta {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.app-name {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 0.15rem 0.5rem 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.status-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-live {
  color: var(--success);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 25%, transparent);
}

.status-live .status-dot {
  box-shadow: 0 0 0 3px var(--success-soft);
  animation: pulse 2s ease-in-out infinite;
}

.status-down {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

.status-beta {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 25%, transparent);
}

.app-chevron {
  color: var(--muted);
  opacity: 0.65;
  display: grid;
  place-items: center;
}

.app-chevron svg {
  width: 1.15rem;
  height: 1.15rem;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-live .status-dot {
    animation: none;
  }

  .app {
    transition: none;
  }
}
