:root {
  --bg: #111418;
  --bg-elev: #1c2128;
  --bg-elev-hover: #262d36;
  --border: #2c333c;
  --text: #e8eaed;
  --text-dim: #9aa3ad;
  --accent: #3b82f6;
  --tile-size: 168px;
  --tile-gap: 20px;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Topbar -------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px clamp(20px, 4vw, 56px);
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(17, 20, 24, 0));
  z-index: 10;
}

.topbar__title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.topbar__search {
  margin-left: auto;
  flex: 0 1 420px;
}

#search {
  width: 100%;
  padding: 14px 20px;
  font-size: 18px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
}

#search::placeholder {
  color: var(--text-dim);
}

#search:focus {
  border-color: var(--accent);
}

/* Grid ---------------------------------------------------------------- */
.grid-wrap {
  padding: 8px clamp(20px, 4vw, 56px) 56px;
}

.group-title {
  margin: 28px 4px 16px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-size), 1fr));
  gap: var(--tile-gap);
}

/* Tile ---------------------------------------------------------------- */
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 16px;
  min-height: 168px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  transition: background-color 0.12s ease, transform 0.12s ease, border-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.tile:hover {
  background: var(--bg-elev-hover);
  border-color: #3a434e;
}

.tile:active {
  transform: scale(0.97);
}

.tile__icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  padding: 6px;
}

.tile__fallback {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 600;
  color: #fff;
}

.tile__name {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  word-break: break-word;
}

.empty {
  color: var(--text-dim);
  font-size: 18px;
  text-align: center;
  padding: 64px 0;
}

/* Grotere tegels op het brede Tesla-touchscreen ----------------------- */
@media (min-width: 1100px) {
  :root {
    --tile-size: 196px;
    --tile-gap: 24px;
  }
}
