/* The apps on the sheet: Drive's tiles (grid) and rows (list). Cards rest
   on white with a 1px edge; the app's own colour (--c, from its icon) only
   arrives on hover, as Drive's folder tiles take theirs. */

.group + .group { margin-top: 30px; }
.group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 28px; }
.group-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 500; color: var(--foreground); }
.group-head h2 svg { width: 16px; height: 16px; color: var(--nav-account); }
.count { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.text-btn {
  margin-inline-start: auto; height: 28px; padding: 0 10px; border-radius: var(--radius-control);
  font-size: 13px; font-weight: 500; color: var(--muted-strong);
}
.text-btn:hover { background: var(--surface-2); color: var(--foreground); }

/* ---- Grid ------------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr)); gap: 12px; }
.card {
  --c: var(--muted);
  position: relative; display: flex; align-items: center; gap: 12px; height: 64px; padding-inline: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface);
  text-decoration: none; min-width: 0;
  transition: border-color 150ms, background-color 150ms, box-shadow 150ms, transform var(--dur-fast) var(--ease-out);
}
.card:hover {
  border-color: color-mix(in srgb, var(--c) 45%, var(--border));
  background: color-mix(in srgb, var(--c) 6%, var(--surface));
}
.card:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--accent); }
.icon { display: grid; place-items: center; flex: none; }
.icon svg, .icon img { display: block; border-radius: 24%; }
.icon img { object-fit: cover; background: var(--surface-2); }
.initial {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 24%;
  background: var(--surface-3); color: var(--muted-strong); font-weight: 600; font-size: 16px;
}
.meta { display: flex; flex-direction: column; min-width: 0; }
.name { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host { font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The result Enter would open: the selected look Drive gives a card. */
.card[data-active], .row[data-active] {
  border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---- List ------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.list-head, .row {
  display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(0, 2fr) minmax(170px, 1fr); gap: 16px; align-items: center;
  padding-inline: 12px;
}
.list-head { height: 36px; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); }
.row {
  --c: var(--muted);
  height: 52px; border-bottom: 1px solid var(--rule);
  text-decoration: none; transition: background-color 100ms;
}
.row:hover { background: color-mix(in srgb, var(--c) 7%, transparent); }
.row:focus-visible { outline-offset: -2px; }
.row[data-active] { box-shadow: inset 0 0 0 2px var(--accent); }
.cell-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-name .icon svg, .cell-name .icon img { border-radius: 24%; }
.cell-name .initial { width: 28px; height: 28px; font-size: 13px; }
.cell-note { font-size: 13.5px; color: var(--muted-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-host { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }

/* ---- Nothing found (Drive's empty folder: a dashed frame, one line, the way out) */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 56px 24px 60px; border: 1px dashed var(--border-strong); border-radius: var(--radius-card);
}
.empty-icon { color: var(--muted-strong); margin-bottom: 10px; }
.empty-icon svg { width: 28px; height: 28px; stroke-width: 1.5; }
.empty-title { margin: 0; font-size: 16px; font-weight: 500; color: var(--foreground); overflow-wrap: anywhere; }
.empty-text { margin: 4px 0 18px; max-width: 30rem; font-size: 14px; line-height: 1.6; color: var(--muted-strong); }
.link-btn {
  color: var(--accent-ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent-line);
  text-underline-offset: 3px; border-radius: 4px;
}
.link-btn:hover { text-decoration-color: currentColor; }
.secondary {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--radius-control);
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 14px; font-weight: 500;
  transition: background-color 150ms, transform var(--dur-fast) var(--ease-out);
}
.secondary:hover { background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) {
  .card, .row, .nav-row, .icon-btn, .secondary { transition: none; }
}
