/* ===========================================================
   GGDB table.css — Redesign v3.0
   白＋オレンジブランドを維持しつつ、視認性・UIを大幅向上
   =========================================================== */

:root {
  --ggj-accent:        #e07a1a;
  --ggj-accent-dark:   #c5660d;
  --ggj-accent-light:  #fff3e8;
  --ggj-accent-mid:    #fde8d0;

  /* Surface */
  --ggj-bg:            #f7f7f5;
  --ggj-surface:       #ffffff;
  --ggj-surface-2:     #fafaf8;
  --ggj-border:        #e8e8e4;
  --ggj-border-light:  #f0f0ec;

  /* Text */
  --ggj-text:          #111111;
  --ggj-text-2:        #555555;
  --ggj-text-3:        #999999;

  /* Table header */
  --ggj-header-bg:     #1e2533;
  --ggj-header-text:   #d4d8e2;

  /* Rank colors */
  --ggj-rank-ss-bg:    #7f1d1d;
  --ggj-rank-s-bg:     #dc2626;
  --ggj-rank-a-bg:     #e07a1a;
  --ggj-rank-b-bg:     #0f766e;
  --ggj-rank-c-bg:     #1d4ed8;
  --ggj-rank-d-bg:     #6d28d9;
  --ggj-rank-e-bg:     #be185d;
  --ggj-rank-f-bg:     #374151;

  /* Status colors */
  --ggj-green:         #16a34a;
  --ggj-red:           #dc2626;
  --ggj-video-red:     #e53935;

  /* Shadows */
  --ggj-shadow-sm:     0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --ggj-shadow-md:     0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
  --ggj-shadow-lg:     0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  --ggj-shadow-orange: 0 4px 20px rgba(224,122,26,0.18);

  /* Radius */
  --ggj-radius-sm:     6px;
  --ggj-radius-md:     10px;
  --ggj-radius-lg:     14px;
  --ggj-radius-pill:   9999px;

  /* Transitions */
  --ggj-ease:          cubic-bezier(0.2, 0, 0, 1);
}

/* ===========================================================
   ROOT / 使い方アコーディオン
   =========================================================== */
.ggj-device-db {
  font-family: inherit;
  color: var(--ggj-text);
}

.ggj-device-db__header {
  margin-bottom: 1.25rem;
}

.ggj-device-db__affiliate-note {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ggj-text-2);
}

.ggj-device-db__usage {
  background: var(--ggj-surface);
  border: 1px solid var(--ggj-border);
  border-radius: var(--ggj-radius-md);
  overflow: hidden;
  box-shadow: var(--ggj-shadow-sm);
}

.ggj-device-db__usage summary {
  padding: 0.75rem 1.2rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ggj-text-2);
  transition: background 0.15s;
  outline: none;
}
.ggj-device-db__usage summary::-webkit-details-marker { display: none; }
.ggj-device-db__usage summary::before {
  content: "▶";
  font-size: 0.6rem;
  transition: transform 0.2s var(--ggj-ease);
  color: var(--ggj-accent);
}
.ggj-device-db__usage[open] summary::before { transform: rotate(90deg); }
.ggj-device-db__usage summary:hover { background: var(--ggj-surface-2); }

.ggj-device-db__usage-content {
  padding: 1rem 1.4rem 1.2rem;
  border-top: 1px solid var(--ggj-border-light);
  background: var(--ggj-surface-2);
}
.ggj-device-db__usage-content ul {
  margin: 0; padding: 0 0 0 1.2rem; list-style: disc;
}
.ggj-device-db__usage-content li {
  margin-bottom: 0.45rem; font-size: 0.83rem;
  color: var(--ggj-text-2); line-height: 1.5;
}
.ggj-device-db__usage-content li:last-child { margin-bottom: 0; }

/* ===========================================================
   フィルターカード
   =========================================================== */
.ggj-device-db__filters-card {
  background: var(--ggj-surface);
  border-radius: var(--ggj-radius-md);
  border: 1px solid var(--ggj-border);
  box-shadow: var(--ggj-shadow-md);
  padding: 1.1rem 1.4rem 1.3rem;
  margin-bottom: 1.5rem;
}

.ggj-device-db__filters-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ggj-text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.ggj-filters-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: var(--ggj-accent-light);
  color: var(--ggj-accent);
  border-radius: 6px;
}
.ggj-filters-icon svg { display: block; }

.ggj-device-db__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  border: none; background: transparent;
  padding: 0; box-shadow: none;
}

.ggj-device-db__field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ggj-text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
  display: block;
}

.ggj-device-db__field select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--ggj-surface-2);
  border: 1.5px solid var(--ggj-border);
  border-radius: var(--ggj-radius-sm);
  padding: 0.55rem 2.4rem 0.55rem 0.9rem;
  font-size: 0.88rem;
  color: var(--ggj-text);
  width: 100%;
  font-weight: 500;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23aaa" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.ggj-device-db__field select:hover { border-color: #c8c8c0; }
.ggj-device-db__field select:focus {
  outline: none;
  border-color: var(--ggj-accent);
  box-shadow: 0 0 0 3px rgba(224,122,26,0.12);
}

.ggj-device-db__reset {
  background: transparent;
  border: 1.5px solid var(--ggj-border);
  color: var(--ggj-text-2);
  padding: 0.55rem 1.4rem;
  border-radius: var(--ggj-radius-pill);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}
.ggj-device-db__reset:hover {
  border-color: var(--ggj-accent);
  color: var(--ggj-accent);
  background: var(--ggj-accent-light);
}

/* ===========================================================
   テーブルラッパー
   =========================================================== */
.ggj-device-db__table-wrap {
  background: var(--ggj-surface);
  border-radius: var(--ggj-radius-md);
  border: 1px solid var(--ggj-border);
  box-shadow: var(--ggj-shadow-md);
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

/* ===========================================================
   テーブル本体
   =========================================================== */
.ggj-device-db__table {
  border-collapse: collapse;
  min-width: 100%;
  border: none;
}

.ggj-device-db__table th {
  background: var(--ggj-header-bg) !important;
  border: none !important;
  border-bottom: 2px solid #2d3650 !important;
  padding: 0.75rem 0.75rem;
  text-align: center;
  vertical-align: middle;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--ggj-header-text) !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ggj-device-db__table th:first-child,
.ggj-device-db__table td:first-child {
  text-align: left;
}

.ggj-device-db__table td {
  border: none;
  padding: 0.9rem 0.75rem;
  text-align: center;
  vertical-align: middle;
  font-size: 0.88rem;
  line-height: 1.35;
}

.ggj-device-db__table tbody tr {
  border-bottom: 1px solid var(--ggj-border-light);
  background: var(--ggj-surface);
  transition: background 0.1s;
}
.ggj-device-db__table tbody tr:last-child { border-bottom: none; }
.ggj-device-db__table tbody tr:hover { background: #fffaf5; }
.ggj-device-db__table tbody tr.is-comparing {
  background: #fff8f0;
}

/* Sticky left column */
.ggj-device-db__table th.is-sticky,
.ggj-device-db__table td.is-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 2px 0 6px rgba(0,0,0,0.05);
}
.ggj-device-db__table td.is-sticky { background: var(--ggj-surface); }
.ggj-device-db__table thead th.is-sticky { z-index: 3 !important; background: var(--ggj-header-bg) !important; }
.ggj-device-db__table tbody tr:hover td.is-sticky { background: #fffaf5; }
.ggj-device-db__table tbody tr.is-comparing td.is-sticky { background: #fff8f0; }

/* Brand / Model compound cell */
.ggj-brand-model {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}
.ggj-brand-model__brand {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ggj-text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ggj-brand-model__name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ggj-text);
  line-height: 1.3;
}

.ggj-device-db__brand-info {
  display: block;
  color: var(--ggj-text-3);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.ggj-device-db__product-info {
  display: block;
  color: var(--ggj-text);
  text-decoration: none;
  transition: color 0.15s;
  min-width: 120px;
  white-space: nowrap;
}
.ggj-device-db__product-info strong {
  display: block;
  font-weight: 700;
  color: var(--ggj-text);
  font-size: var(--ggj-font-size-product, 0.88rem);
  white-space: nowrap;
}
.ggj-device-db__product-info strong.is-wrapped { white-space: normal; }
.ggj-device-db__short-desc {
  font-size: 0.78rem;
  color: var(--ggj-text-3);
  margin-top: 0.25rem;
  line-height: 1.35;
  white-space: normal;
}

/* ===========================================================
   ランクバッジ — 大幅強化
   =========================================================== */
.ggj-device-db__rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--ggj-radius-sm);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.ggj-device-db__rank-badge.is-ss { background: var(--ggj-rank-ss-bg); }
.ggj-device-db__rank-badge.is-s  { background: var(--ggj-rank-s-bg); }
.ggj-device-db__rank-badge.is-a  { background: var(--ggj-rank-a-bg); }
.ggj-device-db__rank-badge.is-b  { background: var(--ggj-rank-b-bg); }
.ggj-device-db__rank-badge.is-c  { background: var(--ggj-rank-c-bg); }
.ggj-device-db__rank-badge.is-d  { background: var(--ggj-rank-d-bg); }
.ggj-device-db__rank-badge.is-e  { background: var(--ggj-rank-e-bg); }
.ggj-device-db__rank-badge.is-f  { background: var(--ggj-rank-f-bg); }
.ggj-device-db__rank-badge.is-pending { background: #d1d5db; color: #6b7280; }

/* ===========================================================
   ボタン全般
   =========================================================== */
.ggj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: var(--ggj-radius-sm);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s var(--ggj-ease);
  border: none;
  font-size: 0.88rem;
  padding: 0.6rem 1.4rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ggj-btn:active { transform: scale(0.97); }

.ggj-btn.is-disabled {
  background: #f1f5f9 !important;
  color: #c0c8d4 !important;
  border-color: transparent !important;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

.ggj-btn--mini {
  padding: 0.32rem 0.65rem !important;
  font-size: 0.74rem !important;
  border-radius: 5px !important;
}

.ggj-btn--primary {
  background: var(--ggj-accent);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(224,122,26,0.3);
}
.ggj-btn--primary:hover {
  background: var(--ggj-accent-dark);
  box-shadow: 0 4px 14px rgba(224,122,26,0.4);
  transform: translateY(-1px);
  color: #fff !important;
}

.ggj-btn--video {
  background: var(--ggj-video-red);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(229,57,53,0.25);
}
.ggj-btn--video:hover {
  background: #c62828;
  box-shadow: 0 4px 14px rgba(229,57,53,0.35);
  transform: translateY(-1px);
  color: #fff !important;
}

.ggj-btn--purchase {
  background: linear-gradient(135deg, var(--ggj-green), #15803d);
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(22,163,74,0.3);
  font-weight: 700;
}
.ggj-btn--purchase:hover {
  background: linear-gradient(135deg, #15803d, #166534);
  box-shadow: 0 4px 16px rgba(22,163,74,0.4);
  transform: translateY(-1px);
  color: #fff !important;
}

.ggj-btn--secondary {
  background: #f1f3f5;
  color: #495057;
}
.ggj-btn--secondary:hover {
  background: #e2e6ea;
  color: #1f2937;
}

/* 一覧テーブル内ボタン */
.ggj-device-db__table td.is-action .ggj-btn,
.ggj-device-db__table td.is-action .ggj-btn--mini {
  min-width: 58px;
  padding: 0.32rem 0.6rem !important;
  font-size: 0.72rem !important;
  border-radius: 5px !important;
}
.ggj-device-db__table td.is-action {
  text-align: center;
}
.ggj-device-db__table td.is-action .ggj-btn--purchase {
  background: #15803d;
  box-shadow: none;
}
.ggj-device-db__table td.is-action .ggj-btn--purchase:hover {
  background: #166534;
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
  transform: none;
}

/* 比較ボタン — ＋ / ✓ のみ */
.ggj-device-db__compare-btn {
  background: transparent;
  border: 1.5px solid var(--ggj-border);
  color: var(--ggj-text-3);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ggj-device-db__compare-btn:hover:not(:disabled) {
  border-color: var(--ggj-accent);
  color: var(--ggj-accent);
  background: var(--ggj-accent-light);
}
.ggj-device-db__compare-btn.is-selected {
  background: var(--ggj-accent);
  border-color: var(--ggj-accent);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(224,122,26,0.25);
}

/* ===========================================================
   詳細モーダル
   =========================================================== */
.ggj-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,16,0.55);
}
.ggj-detail-modal.is-open { display: flex; }

.ggj-detail-modal__overlay {
  position: absolute;
  inset: 0;
  background: transparent;
}
.ggj-detail-modal__panel {
  position: relative;
  background: #f5f5f3;
  width: 95%;
  max-width: 1100px;
  max-height: 90vh;
  border-radius: var(--ggj-radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.1);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s var(--ggj-ease), transform 0.2s var(--ggj-ease);
  overflow: hidden;
  will-change: transform, opacity;
}
.ggj-detail-modal.is-open .ggj-detail-modal__panel {
  opacity: 1;
  transform: translateY(0);
}

.ggj-detail-modal__header {
  padding: 0.9rem 1.5rem;
  background: var(--ggj-header-bg);
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ggj-detail-modal__title {
  font-weight: 700;
  font-size: 1rem;
  color: #e8eaf0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ggj-detail-modal__title .ggj-device-db__rank-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
}
.ggj-detail-modal__close {
  background: rgba(255,255,255,0.1);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 0.9rem;
  color: #a0a8b8;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ggj-detail-modal__close:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.ggj-detail-modal__body {
  padding: 1.25rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #efefed;
}
.ggj-detail { display: flex; flex-direction: column; gap: 0.75rem; }

/* FV section */
.ggj-detail-fv {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.25rem;
  background: var(--ggj-surface);
  padding: 1.5rem 1.75rem;
  border-radius: var(--ggj-radius-md);
  border: 1px solid var(--ggj-border-light);
  box-shadow: var(--ggj-shadow-sm);
}

.ggj-detail-fv__visual { width: 100%; }
.ggj-detail-fv__visual.is-empty .ggj-detail-fv__img-wrap {
  display: flex; align-items: center; justify-content: center;
  background: var(--ggj-surface-2); color: #ddd;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
}
.ggj-detail-fv__img-wrap {
  overflow: hidden;
  border-radius: var(--ggj-radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.ggj-detail-fv__img-wrap img {
  display: block; max-width: 100%; max-height: 100%;
  width: auto; height: auto; object-fit: contain;
}

.ggj-detail-fv__content {
  display: flex; flex-direction: column; gap: 1rem; justify-content: center;
}
.ggj-detail-fv__header { display: flex; align-items: flex-start; gap: 1rem; }
.ggj-detail-fv__info { display: flex; flex-direction: column; gap: 0.3rem; }
.ggj-detail-fv__maker {
  font-size: 0.75rem; color: var(--ggj-text-3);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.ggj-detail-fv__name {
  font-size: 1.7rem; font-weight: 800; margin: 0; line-height: 1.15; color: var(--ggj-text);
}
.ggj-detail-fv__desc {
  font-size: 0.85rem; color: var(--ggj-text-2); line-height: 1.45; margin: 0;
}

/* FV rank icon */
.ggj-rank-detail-icon { display: none; }

/* CTA stack */
.ggj-detail-fv__actions { display: flex; flex-direction: column; }
.ggj-cta-stack { display: flex; flex-direction: column; gap: 0.65rem; }
.ggj-cta-stack .ggj-btn,
.ggj-cta-stack .ggj-device-db__compare-btn { width: 100%; }

.ggj-review-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.ggj-review-buttons .ggj-btn { width: 100%; justify-content: center; }
.ggj-review-buttons.is-detail { width: 100%; }
.ggj-review-buttons.is-list {
  width: 134px; min-width: 134px; margin: 0 auto;
}
.ggj-review-buttons.is-list .ggj-btn {
  padding: 0.32rem 0.6rem !important;
  font-size: 0.72rem !important;
  border-radius: 5px !important;
}

/* Rank block */
.ggj-detail-rank-block {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.25rem;
  background: var(--ggj-surface-2);
  border: 1px solid var(--ggj-border-light);
  border-left: 4px solid #94a3b8;
  border-radius: var(--ggj-radius-sm);
  margin: 0 0 0.75rem;
}
.ggj-detail-rank-block__label {
  font-size: 0.7rem; font-weight: 700; color: var(--ggj-text-3);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ggj-detail-rank-block__val {
  font-size: 1.4rem; font-weight: 900; line-height: 1; color: var(--ggj-text);
}
.ggj-detail-rank-block.is-ss { background: #fef2f2; border-left-color: var(--ggj-rank-ss-bg); }
.ggj-detail-rank-block.is-ss .ggj-detail-rank-block__val { color: var(--ggj-rank-ss-bg); }
.ggj-detail-rank-block.is-s  { background: #fef2f2; border-left-color: var(--ggj-rank-s-bg); }
.ggj-detail-rank-block.is-s  .ggj-detail-rank-block__val { color: var(--ggj-rank-s-bg); }
.ggj-detail-rank-block.is-a  { background: #fff7ed; border-left-color: var(--ggj-rank-a-bg); }
.ggj-detail-rank-block.is-a  .ggj-detail-rank-block__val { color: var(--ggj-rank-a-bg); }
.ggj-detail-rank-block.is-b  { background: #f0fafa; border-left-color: var(--ggj-rank-b-bg); }
.ggj-detail-rank-block.is-b  .ggj-detail-rank-block__val { color: var(--ggj-rank-b-bg); }
.ggj-detail-rank-block.is-c  { background: #eff6ff; border-left-color: var(--ggj-rank-c-bg); }
.ggj-detail-rank-block.is-c  .ggj-detail-rank-block__val { color: var(--ggj-rank-c-bg); }
.ggj-detail-rank-block.is-d  { background: #faf5ff; border-left-color: var(--ggj-rank-d-bg); }
.ggj-detail-rank-block.is-d  .ggj-detail-rank-block__val { color: var(--ggj-rank-d-bg); }
.ggj-detail-rank-block.is-f  { background: #f9fafb; border-left-color: var(--ggj-rank-f-bg); }
.ggj-detail-rank-block.is-f  .ggj-detail-rank-block__val { color: var(--ggj-rank-f-bg); }

/* ===========================================================
   モーダル内スペックセクション
   =========================================================== */
.ggj-detail-section {
  background: var(--ggj-surface);
  padding: 1.1rem 1.4rem;
  border-radius: var(--ggj-radius-md);
  border: 1px solid var(--ggj-border-light);
  box-shadow: none;
  margin-bottom: 0;
}
.ggj-detail-section--desc { background: #fafaf8; }

.ggj-detail-section__title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ggj-text-2);
  margin: 0 0 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f0f0ee;
  border-radius: 4px;
  padding: 0.28rem 0.7rem;
  width: fit-content;
}
.ggj-detail-section__title small {
  font-size: 0.75rem; font-weight: 400; color: var(--ggj-text-3); text-transform: none; letter-spacing: 0;
}

.ggj-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem 1rem;
}
.ggj-detail-grid__item {
  display: flex; flex-direction: column; gap: 0.3rem;
}
.ggj-detail-grid__label {
  font-size: 0.68rem; font-weight: 700; color: var(--ggj-text-3);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 3px;
  display: inline-flex; align-items: center; gap: 0.3rem;
  flex-wrap: wrap;
}
.ggj-detail-grid__label-text { min-width: 0; }
.ggj-detail-grid__val {
  font-size: 1rem; font-weight: 700; color: var(--ggj-text); line-height: 1.2;
}
.ggj-detail-grid__val.is-muted { color: #d0d0cc; font-weight: 500; }

/* Help link */
.ggj-detail-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 0.9rem; height: 0.9rem; border-radius: 999px;
  border: 1px solid #ccc; color: #bbb; font-size: 0.6rem;
  font-weight: 700; line-height: 1; text-decoration: none;
  transition: all 0.15s; position: relative; flex-shrink: 0;
}
.ggj-detail-help:hover, .ggj-detail-help:focus-visible {
  color: var(--ggj-accent); border-color: var(--ggj-accent);
}
.ggj-detail-help::after {
  content: attr(data-tooltip);
  position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: rgba(17,17,17,0.9); color: #fff;
  font-size: 0.68rem; font-weight: 500; line-height: 1.3;
  padding: 0.38rem 0.5rem; border-radius: 5px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.15s; text-transform: none;
  letter-spacing: normal; z-index: 5;
}
.ggj-detail-help:hover::after, .ggj-detail-help:focus-visible::after { opacity: 1; }

/* Review summary */
.ggj-detail-summary {
  background: var(--ggj-accent-light);
  border: 1px solid var(--ggj-accent-mid) !important;
  padding: 1.25rem 1.5rem;
  border-radius: var(--ggj-radius-md);
}
.ggj-detail-summary .ggj-detail-section__title { color: var(--ggj-accent); border-bottom-color: var(--ggj-accent-mid); }
.ggj-detail-summary__content { line-height: 1.7; color: var(--ggj-text-2); margin-bottom: 0.75rem; font-size: 0.9rem; }
.ggj-detail-summary__guide { font-size: 0.82rem; color: var(--ggj-accent); font-weight: 700; margin: 0; text-align: right; }

/* Click badges */
.ggj-click-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.8rem; padding: 0.18rem 0.5rem;
  border-radius: 4px; font-size: 0.8rem; font-weight: 800;
}
.ggj-click-badge.is-S { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.ggj-click-badge.is-A { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.ggj-click-badge.is-B { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ggj-click-badge.is-C { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Related cards */
.ggj-related-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
}
.ggj-related-card {
  background: var(--ggj-surface);
  border: 1.5px solid var(--ggj-border);
  border-radius: var(--ggj-radius-sm);
  padding: 0.9rem;
  cursor: pointer;
  transition: all 0.15s var(--ggj-ease);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.ggj-related-card:hover {
  border-color: var(--ggj-accent);
  box-shadow: 0 4px 16px rgba(224,122,26,0.12);
  transform: translateY(-2px);
}
.ggj-related-card__img {
  width: 72px; height: 72px;
  background-size: contain; background-position: center; background-repeat: no-repeat;
  margin-bottom: 0.6rem;
}
.ggj-related-card__name {
  font-size: 0.8rem; font-weight: 700; margin-top: 0.4rem; line-height: 1.3;
  color: var(--ggj-text);
}

/* Sort hint */
.ggj-sort-hint { display: inline-block; margin-left: 0.6rem; font-size: 0.82rem; color: var(--ggj-text-3); }
.ggj-sort-hint__link { color: inherit; text-decoration: underline; text-underline-offset: 0.12em; }

/* ===========================================================
   スクロールヒント
   =========================================================== */
.ggj-device-db__scroll-hint {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; color: var(--ggj-text-3);
  margin-bottom: 0.4rem; font-weight: 600;
}
.ggj-device-db__scroll-hint svg { fill: #bbb; }

/* ===========================================================
   比較バー（画面下部）
   =========================================================== */
.ggj-compare-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--ggj-header-bg);
  border-top: 2px solid var(--ggj-accent);
  padding: 0.85rem 5%;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.25s var(--ggj-ease), box-shadow 0.25s;
  pointer-events: none;
}
.ggj-compare-bar.is-visible {
  transform: translateY(0);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
  pointer-events: auto;
}
.ggj-compare-bar__info { font-size: 0.88rem; color: #c8cdd8; font-weight: 600; }
.ggj-compare-bar__info small { color: #8890a0; margin-left: 4px; }
.ggj-compare-bar__count { color: var(--ggj-accent); font-weight: 800; font-size: 1.1rem; }
.ggj-compare-bar__actions { display: flex; gap: 0.75rem; }
.ggj-compare-bar__btn {
  padding: 0.55rem 1.4rem; border-radius: var(--ggj-radius-pill);
  font-weight: 700; font-size: 0.88rem; cursor: pointer; border: none;
  transition: all 0.15s;
}
.ggj-compare-bar__btn--open {
  background: var(--ggj-accent); color: #fff;
  box-shadow: 0 2px 8px rgba(224,122,26,0.35);
}
.ggj-compare-bar__btn--open:hover:not(:disabled) {
  background: var(--ggj-accent-dark);
  box-shadow: 0 4px 14px rgba(224,122,26,0.45);
  transform: translateY(-1px);
}
.ggj-compare-bar__btn--open:disabled { background: #3d4458; color: #6b7280; cursor: not-allowed; }
.ggj-compare-bar__btn--clear {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: #a0a8b8;
}
.ggj-compare-bar__btn--clear:hover {
  background: rgba(255,255,255,0.15); color: #e2e6ef;
}

/* ===========================================================
   比較モーダル
   =========================================================== */
.ggj-compare-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: none; align-items: center; justify-content: center;
}
.ggj-compare-modal.is-open { display: flex; }
.ggj-compare-modal__overlay {
  position: absolute; inset: 0;
  background: rgba(10,10,16,0.6);
}
.ggj-compare-modal__panel {
  position: relative;
  background: var(--ggj-surface);
  width: 95%; max-width: 1000px; max-height: 90vh;
  border-radius: var(--ggj-radius-lg);
  display: flex; flex-direction: column;
  box-shadow: var(--ggj-shadow-lg);
  overflow: hidden;
}
.ggj-compare-modal__header {
  padding: 0.9rem 1.25rem;
  background: var(--ggj-header-bg);
  border-bottom: none;
  display: flex; justify-content: space-between; align-items: center;
}
.ggj-compare-modal__title {
  margin: 0; font-size: 1rem; font-weight: 700; color: #e8eaf0;
}
.ggj-compare-modal__close {
  background: rgba(255,255,255,0.1); border: none;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 0.9rem; color: #a0a8b8; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ggj-compare-modal__close:hover { background: rgba(255,255,255,0.2); color: #fff; }
.ggj-compare-modal__body { padding: 1.25rem; overflow: auto; }

/* 比較テーブル */
.ggj-compare-table-wrap { overflow-x: auto; }
.ggj-compare-table {
  width: 100%; border-collapse: collapse;
  min-width: 600px; font-size: 0.82rem; table-layout: fixed;
}
.ggj-compare-table th, .ggj-compare-table td {
  border: 1px solid var(--ggj-border-light);
  padding: 0.6rem 0.6rem; text-align: center;
  overflow: hidden; text-overflow: ellipsis; word-wrap: break-word;
}
.ggj-compare-table__label {
  width: 120px; font-weight: 700;
  background: var(--ggj-surface-2) !important;
  text-align: left !important;
  font-size: 0.75rem; color: var(--ggj-text-2);
}
.ggj-compare-table__product-name {
  font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; line-height: 1.3;
}
.ggj-compare-table__product-maker { font-size: 0.7rem; color: var(--ggj-text-3); }
.ggj-compare-table__product-img {
  width: 100%; max-width: 100px; height: 60px;
  background-color: var(--ggj-surface-2);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  margin: 0 auto; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.ggj-compare-table__row-img .ggj-compare-table__product-cell {
  background: var(--ggj-surface); padding: 0.75rem 0.5rem;
}
.ggj-compare-table__row-info .ggj-compare-table__product-cell {
  background: var(--ggj-surface-2);
}
.ggj-compare-table__cell.is-best {
  background: var(--ggj-accent-light); font-weight: 700;
}
.ggj-compare-table__win-badge {
  display: block; font-size: 0.6rem; color: var(--ggj-accent);
  font-weight: 700; margin-top: 0.15rem; letter-spacing: 0.04em;
}

/* is-compare-view */
.is-compare-view .ggj-compare-table {
  font-size: 0.72rem; border-collapse: separate; border-spacing: 0; table-layout: fixed;
}
.is-compare-view .ggj-compare-table__label {
  text-align: right !important; padding-right: 1.1rem !important;
  width: 120px !important; background: var(--ggj-surface-2) !important;
  font-weight: 800 !important; color: var(--ggj-text-2) !important;
}
.is-compare-view .ggj-compare-table td { padding: 0.55rem 0.4rem !important; }
.is-compare-view .ggj-device-db__rank-badge {
  padding: 0.2rem 0.55rem; font-size: 0.75rem;
}

/* 比較表アクションボタン */
.ggj-compare-table__actions {
  display: flex; flex-direction: column; gap: 0.4rem; width: 100%;
}
.ggj-compare-table__review-buttons {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem; width: 100%;
}
.ggj-compare-table__actions .ggj-btn--mini { width: 100%; }
.ggj-compare-table__purchase-btn { width: 100%; }
.ggj-compare-table__row-actions .ggj-compare-table__label {
  vertical-align: middle; font-size: 0.75rem; color: var(--ggj-text-3);
}

/* ===========================================================
   購入先モーダル
   =========================================================== */
.ggj-purchase-modal {
  position: fixed; inset: 0; z-index: 100000;
  display: none; align-items: flex-end; justify-content: center;
}
.ggj-purchase-modal.is-open { display: flex; }
.ggj-purchase-modal__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
}
.ggj-purchase-modal__panel {
  position: relative; background: var(--ggj-surface);
  width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0;
  padding: 1.4rem 1.4rem 2rem;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh; overflow-y: auto; overscroll-behavior: contain;
}
.ggj-purchase-modal.is-open .ggj-purchase-modal__panel { transform: translateY(0); }
.ggj-purchase-modal__header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem;
}
.ggj-purchase-modal__title {
  font-size: 1rem; font-weight: 800; color: var(--ggj-text); margin: 0;
}
.ggj-purchase-modal__close {
  background: #f3f4f6; border: none; width: 32px; height: 32px; border-radius: 50%;
  font-size: 0.95rem; color: #6b7280; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; flex-shrink: 0;
}
.ggj-purchase-modal__close:hover { background: #e5e7eb; color: var(--ggj-text); }
.ggj-purchase-modal__product {
  font-size: 0.82rem; color: var(--ggj-text-3); margin: 0 0 1.1rem; line-height: 1.3;
}
.ggj-purchase-modal__body { display: flex; flex-direction: column; gap: 0.65rem; }
.ggj-purchase-modal__notice {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 600; color: #92400e;
  background: #fffbeb; border: 1px solid #fcd34d;
  border-radius: var(--ggj-radius-sm); padding: 0.5rem 0.75rem; margin: 0;
}
.ggj-purchase-modal__notice-icon { width: 1.1rem; height: 1.1rem; flex-shrink: 0; fill: #d97706; }

/* 購入先ボタン */
.ggj-purchase-btn {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  background: var(--ggj-surface-2);
  border: 1.5px solid var(--ggj-border);
  border-radius: var(--ggj-radius-md);
  text-decoration: none; color: var(--ggj-text); font-weight: 700;
  transition: all 0.15s var(--ggj-ease);
}
.ggj-purchase-btn:hover {
  border-color: var(--ggj-green);
  box-shadow: 0 4px 16px rgba(22,163,74,0.12);
  transform: translateY(-1px);
  color: #15803d;
}
.ggj-purchase-btn__icon {
  width: 1.1rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ggj-purchase-btn__label { flex: 1; font-size: 0.92rem; }
.ggj-purchase-btn__arrow { width: 15px; height: 15px; flex-shrink: 0; color: #ccc; }
.ggj-purchase-btn:hover .ggj-purchase-btn__arrow { color: var(--ggj-green); }

@media (min-width: 560px) {
  .ggj-purchase-modal { align-items: center; }
  .ggj-purchase-modal__panel {
    border-radius: 18px; margin-bottom: 0;
    transform: scale(0.95) translateY(8px); opacity: 0;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s;
  }
  .ggj-purchase-modal.is-open .ggj-purchase-modal__panel {
    transform: scale(1) translateY(0); opacity: 1;
  }
}

/* ===========================================================
   無効ボタン
   =========================================================== */
.ggj-btn.is-disabled {
  background: #f1f5f9 !important;
  color: #c0c8d4 !important;
  border: none !important;
  cursor: not-allowed; pointer-events: none;
  box-shadow: none !important; transform: none !important;
}

/* ===========================================================
   アイコン
   =========================================================== */
.ggj-icon-svg {
  width: 1em; height: 1em;
  display: inline-block; vertical-align: -0.125em; flex-shrink: 0;
}

/* ===========================================================
   メタ / 件数表示
   =========================================================== */
.ggj-device-db__meta { margin-bottom: 0.5rem; }
.ggj-device-db__summary {
  font-size: 0.95rem; color: var(--ggj-text-2); font-weight: 600;
}

/* ===========================================================
   サイズバッジ
   =========================================================== */
.ggj-device-db__size-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.8rem; padding: 0.15rem 0.5rem;
  background: var(--ggj-surface-2); border: 1px solid var(--ggj-border);
  border-radius: 4px; font-size: 0.8rem; font-weight: 700;
  color: var(--ggj-text-2);
}

/* ===========================================================
   アニメーション
   =========================================================== */
@keyframes ggjFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ggjSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================================================
   スマートフォン対応
   =========================================================== */
@media (max-width: 767px) {
  .ggj-device-db__filters-card { padding: 1rem 1rem 1.1rem; }

  .ggj-device-db__table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ggj-device-db__table th,
  .ggj-device-db__table td { padding: 0.75rem 0.6rem; white-space: nowrap; font-size: 0.88rem; }

  :root {
    --ggj-font-size-brand: 0.88rem;
    --ggj-font-size-product: 0.88rem;
  }
  .ggj-device-db td .ggj-device-db__brand-info,
  .ggj-device-db td .ggj-device-db__product-info strong {
    font-size: 0.88rem !important; white-space: nowrap;
  }
  .ggj-device-db td .ggj-device-db__product-info strong { display: inline-block; }
  .ggj-device-db__brand-info { white-space: nowrap; }
  .is-mobile-hidden { display: none !important; }

  .ggj-detail-modal__body { padding: 0; font-size: 0.85rem; background: #e8e9eb; }
  .ggj-detail-modal__panel {
    width: 100%; height: 100%; border-radius: 0; max-height: 100%;
  }
  .ggj-detail { gap: 0.5rem; }
  .ggj-detail-fv {
    grid-template-columns: 1fr; padding: 1.1rem; gap: 0.75rem;
    border-radius: 0; margin-bottom: 0;
  }
  .ggj-detail-fv__visual { order: 1; }
  .ggj-detail-fv__content { order: 2; text-align: center; }
  .ggj-detail-fv__header { flex-direction: column; align-items: center; gap: 0.5rem; }
  .ggj-detail-fv__img-wrap { min-height: auto; border-radius: 0; }
  .ggj-detail-fv__img-wrap img { max-width: 100%; display: block; margin: 0 auto; }
  .ggj-detail-fv__name { font-size: 1.25rem; }
  .ggj-detail-rank-block { border-radius: 0; padding: 0.65rem 1rem; }
  .ggj-detail-section {
    padding: 1.1rem 1rem; border-radius: 0; border: none; margin-bottom: 0; box-shadow: none;
  }
  .ggj-detail-section__title { font-size: 0.72rem; margin-bottom: 0.9rem; }
  .ggj-detail-grid {
    grid-template-columns: 1fr;
    gap: 0; border-top: 1px solid var(--ggj-border-light);
  }
  .ggj-detail-grid__item {
    padding: 0.8rem 0; border-bottom: 1px solid var(--ggj-border-light);
    flex-direction: row; justify-content: space-between; align-items: center;
  }
  .ggj-detail-grid__item:last-child { border-bottom: none; }
  .ggj-detail-grid__label { margin-bottom: 0; width: 45%; font-size: 0.7rem; }
  .ggj-detail-grid__val { width: 55%; text-align: right; font-size: 0.9rem; }
  .ggj-detail-help::after { display: none; }

  .is-compare-view .ggj-compare-table { font-size: 0.68rem !important; }
  .is-compare-view .ggj-compare-table__label { width: 100px !important; padding-right: 0.8rem !important; }

  .ggj-compare-bar { padding: 0.5rem 4%; }
  .ggj-compare-bar__info { font-size: 0.75rem; }
  .ggj-compare-bar .ggj-btn, .ggj-compare-bar__btn { font-size: 0.72rem; padding: 0.35rem 0.75rem; }
}
