* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; color: #1f2937; }
nav { display: flex; gap: 16px; padding: 10px 20px; background: #1e3a8a; }
nav a { color: #fff; text-decoration: none; }
nav .brand { font-weight: bold; margin-right: 16px; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }

.cat-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab { padding: 6px 14px; border: 1px solid #d1d5db; border-radius: 6px; text-decoration: none; color: #374151; }
.tab.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.controls { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.controls input[type=text] { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; min-width: 240px; }
.controls select, .controls button { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; cursor: pointer; }

.layout { display: flex; gap: 20px; }
.sidebar { width: 220px; flex-shrink: 0; }
.facet-group { margin-bottom: 4px; }
.facet-group summary { cursor: pointer; font-size: 13px; font-weight: bold;
  color: #6b7280; padding: 6px 0; user-select: none; list-style-position: inside; }
.facet-group summary:hover { color: #374151; }
.facet-group[open] summary { margin-bottom: 4px; }
.facet-group ul { list-style: none; margin: 0; padding: 0 0 4px 20px; }
.facet-group li { padding: 1px 0; }
.facet-cb-label { display: flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer; }
.facet-cb-label:hover { color: #2563eb; }
.facet-cb { accent-color: #2563eb; margin: 0; flex-shrink: 0; }
.facet-cb:checked + * , .facet-cb-label:has(.facet-cb:checked) { color: #dc2626; font-weight: bold; }
.facet-clear { margin-bottom: 8px; }
.facet-clear a { font-size: 12px; color: #dc2626; }
.share { margin-top: 16px; }
.share h4 { margin: 0 0 6px; font-size: 13px; color: #6b7280; }
.share input { width: 100%; font-size: 11px; box-sizing: border-box; }
.share #share-qr { margin-top: 8px; }
.search-save { margin-top: 8px; }
.search-save input { width: 100%; font-size: 12px; box-sizing: border-box; margin-bottom: 4px; }
.search-save button { font-size: 12px; }
.search-query { font-size: 11px; word-break: break-all; margin-bottom: 6px; }
.search-edit { display: flex; gap: 4px; }
.search-edit input { flex: 1; font-size: 12px; min-width: 0; }

.results { flex: 1; }
.result-line { color: #6b7280; font-size: 13px; }
.product-row { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; }
.product-row img { flex-shrink: 0; }
.pinfo { flex: 1; }
.pinfo a { color: #1d4ed8; text-decoration: none; }
.specs { font-size: 12px; color: #6b7280; }
.specs span { margin-right: 10px; }
.price { color: #dc2626; font-weight: bold; font-size: 17px; }
.price .shop { color: #6b7280; font-weight: normal; font-size: 12px; }
.save-btn { padding: 6px 12px; border: 1px solid #2563eb; color: #2563eb; background: #fff; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.save-btn:hover { background: #eff6ff; }
.saved { color: #16a34a; font-size: 13px; }
.next-btn { display: block; margin: 16px auto; padding: 8px 24px; }

.detail-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
table.shops, table.specs-table { border-collapse: collapse; width: 100%; margin-bottom: 20px; }
table.shops th, table.shops td, table.specs-table th, table.specs-table td { border: 1px solid #e5e7eb; padding: 8px; text-align: left; font-size: 14px; }
table.specs-table th { width: 180px; background: #f9fafb; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; }
.card-name { font-weight: bold; margin: 8px 0; }
.card-name a { color: #1d4ed8; text-decoration: none; }
.card-price { font-size: 14px; margin-bottom: 8px; }
.delta.down { color: #16a34a; }
.delta.up { color: #dc2626; }
.del-btn { margin-top: 8px; padding: 4px 12px; border: 1px solid #dc2626; color: #dc2626; background: #fff; border-radius: 6px; cursor: pointer; }

.muted { color: #9ca3af; }
.error { color: #dc2626; }

.site-badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.site-kakaku { background: #e0f2fe; color: #0369a1; }
.site-rakuten { background: #fee2e2; color: #b91c1c; }
.site-yahoo { background: #fef3c7; color: #b45309; }
.site-amazon { background: #fef9c3; color: #a16207; }
.site-error { color: #dc2626; font-size: 12px; margin-left: 10px; }
