:root {
  --bg: #0a0e1a;
  --panel: #14161a;
  --border: #2a2d33;
  --text: #d0d0d0;
  --muted: #8b8f99;
  --accent: #22d3ee;
  --accent2: #a855f7;
  --bad: #e57373;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
}
header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.logo {
  width: 48px; height: 48px; flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.25));
}
.branding { flex: 1; min-width: 0; }
h1 { margin: 0; font-size: 20px; font-weight: 600;
     background: linear-gradient(90deg, var(--accent), var(--accent2));
     -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.meta {
  margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center;
  gap: 0 16px; font-family: ui-monospace, monospace; font-size: 11px;
}
.meta::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
  animation: meta-pulse 2s ease-in-out infinite;
}
@keyframes meta-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}
.meta-cell { display: inline-flex; gap: 6px; align-items: baseline; }
.meta-cell .k {
  text-transform: uppercase; letter-spacing: 1.4px; font-size: 9.5px;
  color: var(--muted); opacity: 0.65;
}
.meta-cell .v { color: var(--accent); }
.meta-sep {
  display: inline-block; width: 1px; height: 11px;
  background: var(--border); align-self: center;
}
.controls {
  padding: 12px 24px; display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center; border-bottom: 1px solid var(--border);
}
.controls input[type=search] {
  flex: 1; min-width: 220px; background: var(--panel); border: 1px solid var(--border);
  color: var(--text); padding: 6px 10px; border-radius: 4px; font-size: 13px;
}
#chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  padding: 4px 10px; border-radius: 12px; font-size: 12px; cursor: pointer; user-select: none;
}
.chip.on { background: rgba(34,211,238,0.12); border-color: var(--accent); color: var(--accent); }
.grid {
  display: grid; gap: 12px; padding: 16px 24px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; display: flex; flex-direction: column;
}
.card img {
  width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; display: block;
}
.card .miss { display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; background: #1a1d22; color: var(--muted); font-size: 11px; }
.card .meta-row { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.card code.path,
.card .name {
  display: block;
  white-space: nowrap;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;          /* legacy Edge */
  /* fade the right edge to hint that text continues past the visible area */
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
}
.card code.path::-webkit-scrollbar,
.card .name::-webkit-scrollbar { display: none; }
.card code.path {
  font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted);
}
.card .name {
  font-family: ui-monospace, monospace; font-size: 14px; font-weight: 400;
  color: var(--accent); letter-spacing: 0.2px;
}
.card .row2 { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); }
.badge.tier-cached    { color: var(--accent); border-color: var(--accent); }
.badge.tier-rendered  { color: var(--accent2); border-color: var(--accent2); }
.badge.tier-icon-fallback { color: var(--muted); }
.badge.tier-error     { color: var(--bad); border-color: var(--bad); }
button.copy {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 2px 8px; border-radius: 4px; font-size: 11px; cursor: pointer;
}
button.copy:hover { color: var(--text); border-color: var(--accent); }
.empty { padding: 60px 24px; text-align: center; color: var(--muted); }
footer { padding: 16px 24px; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--border); margin-top: 24px; }
