* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'Segoe UI', sans-serif; background: #f5f5f5; color: #333; }
header { background: #1a237e; color: #fff; padding: 1.5rem; text-align: center; }
header h1 { font-size: 1.5rem; }
#updated-at { font-size: 0.85rem; opacity: 0.8; margin-top: 0.3rem; }
main { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1rem; }
.card { background: #fff; border-radius: 8px; padding: 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow: hidden; }
.card h3 { font-size: 1rem; margin-bottom: 0.5rem; word-break: break-word; }
.card .price { font-size: 1.8rem; font-weight: bold; color: #1a237e; }
.card .meta { font-size: 0.8rem; color: #888; margin-top: 0.5rem; word-break: break-word; }
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.75rem; font-weight: bold; color: #fff; }
.badge-buy { background: #2e7d32; }
.badge-almost { background: #f9a825; color: #333; }
.badge-high { background: #9e9e9e; }
.badge-error { background: #c62828; }
.btn-shop { display: inline-block; margin-top: 0.8rem; padding: 0.5rem 1rem; background: #ff6f00; color: #fff; text-decoration: none; border-radius: 4px; font-size: 0.85rem; }
.btn-shop:hover { background: #e65100; }
#chart-section { margin-top: 2rem; background: #fff; padding: 1.5rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
#chart-section canvas { width: 100% !important; max-height: 400px; }
@media (max-width: 600px) {
  #chart-section canvas { max-height: 300px; }
  #chart-section { padding: 1rem 0.5rem; }
}
.loading { text-align: center; padding: 3rem 1rem; color: #888; font-size: 1rem; }
.loading::after { content: ''; display: inline-block; width: 1em; animation: dots 1.5s steps(3) infinite; }
@keyframes dots { 0% { content: ''; } 33% { content: '.'; } 66% { content: '..'; } 100% { content: '...'; } }
footer { text-align: center; padding: 1.5rem; font-size: 0.8rem; color: #888; }

/* ---- フィルタバー ---- */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  min-width: 4.5rem;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
/* ピル型ボタン */
.pill {
  padding: 0.25rem 0.75rem;
  border: 1.5px solid #c5cae9;
  border-radius: 999px;
  background: #fff;
  color: #555;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.5;
}
.pill:hover {
  border-color: #1a237e;
  color: #1a237e;
}
.pill.active {
  background: #1a237e;
  border-color: #1a237e;
  color: #fff;
}
/* フィルタ結果なし */
.no-results {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #888;
  font-size: 0.95rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}
@media (max-width: 600px) {
  .filter-label { min-width: 3.5rem; font-size: 0.75rem; }
  .pill { font-size: 0.75rem; padding: 0.2rem 0.6rem; }
}
