/* Komplete Compare Tool - styles
 * Color scheme: rx-compare-app 踏襲（#b4bcfd ライトラベンダー + #42388e ダークインディゴ）
 */

:root {
  --color-accent-light: #b4bcfd;
  --color-accent-dark: #42388e;
  --color-bg: #ffffff;
  --color-bg-soft: #fafafa;
  --color-text: #222;
  --color-text-soft: #555;
  --color-warning: #cf2e2e;
  --color-border: #e0e0e0;
  --color-success: #2a8d2a;
  --color-new-bg: #42388e;
  --color-new-fg: #ffffff;
  --color-versionup-bg: #b4bcfd;
  --color-versionup-fg: #2a256a;
  --color-exclusive-bg: #f0c850;
  --color-exclusive-fg: #5a4400;
  --color-included-bg: #ececec;
  --color-included-fg: #555;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", "游ゴシック", "Yu Gothic", Meiryo, sans-serif;
  color: var(--color-text);
  background: var(--color-bg-soft);
  line-height: 1.6;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: var(--color-accent-light);
  border-bottom: 2px solid var(--color-accent-dark);
  padding: 20px 0 12px;
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.site-logo img {
  display: block;
  height: 40px;
  width: auto;
}

.site-titles {
  flex: 1;
  min-width: 280px;
}

.site-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--color-accent-dark);
}

.site-title-beta {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.7rem;
  background: var(--color-accent-dark);
  color: #fff;
  border-radius: 4px;
  vertical-align: middle;
}

.site-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-soft);
}

.site-disclosure {
  max-width: 1280px;
  margin: 8px auto 0;
  padding: 0 16px;
  font-size: 0.7rem;
  color: var(--color-text-soft);
}

/* Selector */
.selector-section {
  background: var(--color-bg);
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.selector-heading {
  font-size: 1.2rem;
  margin: 0 0 4px;
  color: var(--color-accent-dark);
}

.selector-help {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin: 0 0 16px;
}

.selector-block {
  margin-bottom: 16px;
}

.selector-label {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-accent-dark);
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-group-empty {
  margin: 0;
  padding: 10px 14px;
  background: #f5f5f5;
  color: var(--color-text-soft);
  border-radius: 8px;
  font-size: 0.85rem;
}

.opt-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--color-accent-light);
  background: #fff;
  color: var(--color-accent-dark);
  padding: 16px 28px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  min-width: 160px;
  letter-spacing: 0.02em;
}

.opt-btn:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent-dark);
}

.opt-btn:focus-visible {
  outline: 3px solid var(--color-accent-dark);
  outline-offset: 2px;
}

.opt-btn.is-active {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #fff;
  box-shadow: 0 2px 6px rgba(66, 56, 142, 0.3);
}

.opt-btn.is-active:hover {
  background: #2e2570;
}

.selector-current {
  margin: 12px 0 0;
  padding: 8px 12px;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Empty state */
.empty-state {
  padding: 48px 0;
}

.empty-state-box {
  background: var(--color-bg);
  border: 2px dashed var(--color-accent-light);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon {
  font-size: 2.5rem;
  color: var(--color-accent-light);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 0.95rem;
  color: var(--color-text-soft);
  margin: 0;
}

/* Result */
.result-section {
  padding: 32px 0;
}

.result-heading {
  font-size: 1.3rem;
  color: var(--color-accent-dark);
  margin: 0 0 4px;
}

.result-note {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin: 0 0 24px;
}

.cards-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (min-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* === Cards view: per-edition product gallery === */
.cards-view {
  margin-top: 8px;
}

.target-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 6px;
  background: var(--color-bg-soft);
  border-radius: 10px;
}

.target-tab {
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid transparent;
  background: transparent;
  color: var(--color-accent-dark);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.target-tab:hover {
  background: #fff;
  border-color: var(--color-accent-light);
}

.target-tab.is-active {
  background: var(--color-accent-dark);
  color: #fff;
  border-color: var(--color-accent-dark);
}

.target-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border: 2px solid var(--color-accent-light);
  border-radius: 10px;
  margin-bottom: 20px;
}

.target-summary-head {
  flex: 1;
  min-width: 280px;
}

.target-summary-title {
  font-size: 1rem;
  margin: 0 0 8px;
  color: var(--color-accent-dark);
}

.target-summary-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--color-bg-soft);
  color: var(--color-text-soft);
}

.stat-pill--new { background: var(--color-new-bg); color: var(--color-new-fg); }
.stat-pill--versionup { background: var(--color-versionup-bg); color: var(--color-versionup-fg); }
.stat-pill--exclusive { background: var(--color-exclusive-bg); color: var(--color-exclusive-fg); }
.stat-pill--total { background: var(--color-accent-dark); color: #fff; }

.target-summary-price {
  text-align: right;
  min-width: 200px;
}

.price-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  line-height: 1.2;
}

.price-amount small {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--color-text-soft);
  margin-left: 2px;
}

.price-label {
  font-size: 0.75rem;
  color: var(--color-text-soft);
  margin-top: 2px;
}

.price-downgrade-warning {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--color-warning);
  font-weight: 600;
}

/* 価格 比較表示 */
.price-amount--sale {
  color: var(--color-warning);
}

.price-comparison {
  font-size: 0.78rem;
  margin: 4px 0 2px;
  color: var(--color-text-soft);
  font-weight: 600;
}

.price-comparison.is-sale {
  color: var(--color-warning);
  font-weight: 700;
}

/* edition-block-price 内の場合は白文字で */
.edition-block-price .price-comparison {
  color: rgba(255,255,255,0.85);
}

.edition-block-price .price-comparison.is-sale,
.edition-block-price .price-amount--sale {
  color: #ffe080;
}

/* モーダルパス表示の比較 */
.path-orig-price {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  text-decoration: line-through;
  font-weight: 500;
}

.path-savings {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

.path-savings--sale {
  background: var(--color-warning);
  color: #fff;
}

.path-price--sale {
  color: var(--color-warning);
}

.product-section {
  margin-bottom: 24px;
}

.product-section-heading {
  font-size: 1rem;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.product-section--new .product-section-heading {
  background: var(--color-new-bg);
  color: var(--color-new-fg);
}

.product-section--version-up .product-section-heading {
  background: var(--color-versionup-bg);
  color: var(--color-versionup-fg);
}

.product-section--exclusive .product-section-heading {
  background: var(--color-exclusive-bg);
  color: var(--color-exclusive-fg);
}

.product-cards {
  display: grid;
  gap: 10px;
  /* スマホ: 2列がデフォルト */
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 600px) {
  .product-cards {
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (min-width: 800px) {
  .product-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1300px) {
  .product-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(66, 56, 142, 0.06);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

@media (min-width: 600px) {
  .product-card {
    padding: 14px;
  }
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(66, 56, 142, 0.15);
  transform: translateY(-1px);
}

.product-card--new {
  border-top: 3px solid var(--color-new-bg);
}

.product-card--version-up {
  border-top: 3px solid var(--color-versionup-bg);
}

.product-card--exclusive {
  border-top: 3px solid var(--color-exclusive-bg);
}

.product-card-thumb {
  display: block;
  position: relative;
  width: calc(100% + 20px);
  margin: -10px -10px 8px -10px;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
}

@media (min-width: 600px) {
  .product-card-thumb {
    width: calc(100% + 28px);
    margin: -14px -14px 10px -14px;
  }
}

.product-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.product-card-thumb:hover img {
  transform: scale(1.04);
  opacity: 0.85;
}

.product-card-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 0, 0, 0.85);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding-left: 3px;
  pointer-events: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.product-card-thumb:hover .product-card-play-icon {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(255, 0, 0, 1);
}

/* プレースホルダ（YouTube/画像なし） */
.product-card-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  background: linear-gradient(135deg, #42388e 0%, #5a4cb1 100%);
  position: relative;
}

.product-card-thumb-placeholder-inner {
  text-align: center;
  padding: 12px;
  color: #fff;
}

.product-card-thumb-placeholder-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.product-card-thumb-placeholder-cat {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.75;
  background: rgba(255,255,255,0.18);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
}

/* カテゴリ別色 */
.product-card-thumb--cat-synth { background: linear-gradient(135deg, #5b3fb3 0%, #8c5cea 100%); }
.product-card-thumb--cat-sampler { background: linear-gradient(135deg, #2c5fbe 0%, #5b8fdf 100%); }
.product-card-thumb--cat-keys { background: linear-gradient(135deg, #b35a4f 0%, #e0856e 100%); }
.product-card-thumb--cat-bass { background: linear-gradient(135deg, #5e3010 0%, #a45a2a 100%); }
.product-card-thumb--cat-guitar { background: linear-gradient(135deg, #8a3a18 0%, #d97138 100%); }
.product-card-thumb--cat-drums { background: linear-gradient(135deg, #3d3d3d 0%, #6b6b6b 100%); }
.product-card-thumb--cat-effect { background: linear-gradient(135deg, #1a6e8a 0%, #3a9fb8 100%); }
.product-card-thumb--cat-mastering { background: linear-gradient(135deg, #1a5c3a 0%, #3aaf6c 100%); }
.product-card-thumb--cat-mixing { background: linear-gradient(135deg, #2a8e60 0%, #5fc88f 100%); }
.product-card-thumb--cat-library { background: linear-gradient(135deg, #6b3d8a 0%, #a06bbf 100%); }
.product-card-thumb--cat-expansion { background: linear-gradient(135deg, #b09340 0%, #e0c270 100%); }
.product-card-thumb--cat-instrument { background: linear-gradient(135deg, #5a4cb1 0%, #b4bcfd 100%); }
.product-card-thumb--cat-choir { background: linear-gradient(135deg, #7a3870 0%, #b0589f 100%); }

.product-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 6px;
}

.product-card-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.product-card-badge.is-new { background: var(--color-new-bg); color: var(--color-new-fg); }
.product-card-badge.is-versionup { background: var(--color-versionup-bg); color: var(--color-versionup-fg); }
.product-card-badge.is-exclusive { background: var(--color-exclusive-bg); color: var(--color-exclusive-fg); }
.product-card-badge.is-included { background: var(--color-included-bg); color: var(--color-included-fg); }

.product-card-category {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--color-text-soft);
  letter-spacing: 0.06em;
}

.product-card-name {
  font-size: 0.85rem;
  margin: 0 0 2px;
  color: var(--color-accent-dark);
  font-weight: 700;
  line-height: 1.25;
}

.product-card-name-ja {
  font-size: 0.7rem;
  color: var(--color-text-soft);
  margin: 0 0 6px;
}

.product-card-desc {
  font-size: 0.72rem;
  color: var(--color-text);
  margin: 4px 0 0;
  line-height: 1.45;
  flex: 1;
}

@media (min-width: 600px) {
  .product-card-name {
    font-size: 1rem;
    line-height: 1.3;
  }
  .product-card-name-ja {
    font-size: 0.78rem;
    margin: 0 0 8px;
  }
  .product-card-desc {
    font-size: 0.8rem;
    margin: 6px 0 0;
    line-height: 1.5;
  }
}

.product-grid-empty {
  padding: 32px;
  text-align: center;
  color: var(--color-text-soft);
  background: var(--color-bg-soft);
  border-radius: 10px;
}

/* Version-up changes block inside product card */
.product-card-changes {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(180, 188, 253, 0.18);
  border-left: 3px solid var(--color-versionup-bg);
  border-radius: 0 6px 6px 0;
}

.product-card-changes-heading {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-versionup-fg);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.product-card-changes-list {
  margin: 0;
  padding-left: 16px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-text);
}

.product-card-changes-list li {
  margin-bottom: 2px;
}

/* All-editions view */
.all-view-intro {
  margin-bottom: 8px;
}

.all-view-title {
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: var(--color-accent-dark);
}

.all-view-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-soft);
  line-height: 1.6;
}

.edition-block {
  margin-bottom: 32px;
  padding: 0;
  background: #fff;
  border: 2px solid var(--color-accent-light);
  border-radius: 12px;
  overflow: hidden;
}

.edition-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(to right, var(--color-accent-dark), #5a4cb1);
  color: #fff;
}

.edition-block-head.is-downgrade {
  background: linear-gradient(to right, #888, #aaa);
}

.edition-block-title-area {
  flex: 1;
  min-width: 280px;
}

.edition-block-title {
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: #fff;
}

.edition-block-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.edition-block-stats .stat-pill {
  font-size: 0.7rem;
}

.edition-block-price {
  text-align: right;
  min-width: 200px;
  color: #fff;
}

.edition-block-price .price-amount {
  font-size: 1.4rem;
  color: #fff;
}

.edition-block-price .price-amount small {
  color: rgba(255,255,255,0.7);
}

.edition-block-price .price-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.85);
}

.edition-block-price .price-downgrade-warning {
  color: #ffd0d0;
}

.edition-block-body {
  padding: 16px 20px;
}

@media (max-width: 599px) {
  .edition-block-body {
    padding: 12px;
  }
  .edition-block-head {
    padding: 12px 14px;
  }
  .edition-block-title {
    font-size: 1.05rem;
  }
  .edition-block-stats .stat-pill {
    font-size: 0.65rem;
    padding: 2px 7px;
  }
  .edition-block-price .price-amount {
    font-size: 1.2rem;
  }
  /* product card head badge tighter on mobile */
  .product-card-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  .product-card-category {
    font-size: 0.6rem;
  }
  .product-section-heading {
    font-size: 0.85rem;
    padding: 6px 10px;
  }
  .product-card-changes {
    margin-top: 6px;
    padding: 6px 8px;
  }
  .product-card-changes-heading {
    font-size: 0.65rem;
  }
  .product-card-changes-list {
    font-size: 0.7rem;
    padding-left: 14px;
  }
}

.edition-block-body .product-section {
  margin-bottom: 16px;
}

.edition-block-body .product-section:last-child {
  margin-bottom: 0;
}

/* Legacy edition-card kept for compatibility (not used in new view) */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(66, 56, 142, 0.08);
  display: flex;
  flex-direction: column;
}

.card-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.card-edition-badge {
  display: inline-block;
  padding: 3px 8px;
  background: var(--color-accent-dark);
  color: #fff;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.card-edition-badge.is-source {
  background: #888;
}

.card-title {
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: var(--color-accent-dark);
}

.card-pricing {
  margin: 8px 0;
  font-size: 0.9rem;
}

.price-line {
  margin: 2px 0;
}

.price-line--regular {
  color: var(--color-text);
  font-weight: 600;
}

.price-line--sale {
  color: var(--color-warning);
  font-weight: 700;
}

.price-label {
  font-size: 0.75rem;
  color: var(--color-text-soft);
  margin: 4px 0 0;
}

.buy-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--color-accent-dark);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  width: 100%;
}

.buy-btn:hover {
  background: #2e2570;
}

.buy-btn.is-disabled {
  background: #aaa;
  cursor: not-allowed;
  pointer-events: none;
}

.downgrade-warning {
  margin: 8px 0 0;
  padding: 6px 8px;
  font-size: 0.75rem;
  color: var(--color-warning);
  background: #fff0f0;
  border-radius: 4px;
}

/* Card body */
.card-body {
  flex: 1;
}

.card-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.card-summary-title {
  font-size: 0.9rem;
  margin: 0;
  color: var(--color-accent-dark);
}

.card-summary-count {
  font-size: 0.75rem;
  color: var(--color-text-soft);
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-item {
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-border);
}

.feature-item:last-child {
  border-bottom: none;
}

.feature-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.feature-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.feature-name-ja {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--color-text-soft);
}

.feature-status-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.feature-status-badge.is-new {
  background: var(--color-new-bg);
  color: var(--color-new-fg);
}

.feature-status-badge.is-versionup {
  background: var(--color-versionup-bg);
  color: var(--color-versionup-fg);
}

.feature-status-badge.is-exclusive {
  background: var(--color-exclusive-bg);
  color: var(--color-exclusive-fg);
}

.feature-status-badge.is-included {
  background: var(--color-included-bg);
  color: var(--color-included-fg);
}

.feature-desc {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-soft);
  line-height: 1.45;
}

.tier-separator {
  list-style: none;
  margin: 12px 0 4px;
  padding: 4px 8px;
  background: var(--color-bg-soft);
  border-left: 3px solid var(--color-accent-light);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.no-diff-note {
  padding: 12px;
  background: var(--color-bg-soft);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-text-soft);
  text-align: center;
  margin: 12px 0 0;
}

/* View toggle */
.result-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.view-toggle {
  display: inline-flex;
  background: #fff;
  border: 2px solid var(--color-accent-light);
  border-radius: 8px;
  overflow: hidden;
}

.view-toggle-btn {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: var(--color-accent-dark);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  background: var(--color-bg-soft);
}

.view-toggle-btn.is-active {
  background: var(--color-accent-dark);
  color: #fff;
}

/* Matrix view */
.matrix-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.matrix-table {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(6, minmax(110px, 1fr));
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.85rem;
  min-width: 900px;
}

.matrix-header-row,
.matrix-row,
.matrix-price-row {
  display: contents;
}

.matrix-cell {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.matrix-cell:last-child {
  border-right: none;
}

.matrix-cell--corner {
  background: var(--color-accent-dark);
  color: #fff;
  font-weight: 700;
  text-align: left;
}

.matrix-cell--colhead {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.3;
  align-items: center;
}

.colhead-version {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.7;
}

.matrix-cell--rowhead {
  background: var(--color-bg-soft);
  font-weight: 600;
  text-align: left;
  align-items: flex-start;
}

.matrix-cell-category {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-soft);
  font-weight: 400;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.matrix-cell--data {
  text-align: center;
  align-items: center;
}

.matrix-cell--price {
  text-align: center;
  align-items: center;
  font-size: 0.8rem;
  background: #fffaf0;
}

.matrix-cell--price.is-downgrade {
  background: #fff0f0;
  color: var(--color-warning);
}

.matrix-cell--price small {
  display: block;
  font-size: 0.65rem;
  color: var(--color-text-soft);
  margin-top: 2px;
}

/* Group headers spanning all columns */
.matrix-group-header {
  grid-column: 1 / -1;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
  border-top: 2px solid var(--color-accent-light);
}

.matrix-group-header--new {
  background: var(--color-accent-dark);
  color: #fff;
}

.matrix-group-header--version-up {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

.matrix-group-header--owned {
  background: #ececec;
  color: var(--color-text-soft);
}

.matrix-row--owned .matrix-cell--rowhead {
  opacity: 0.55;
}

.matrix-row--owned .matrix-cell--data {
  opacity: 0.4;
}

/* Cell marks */
.cell-mark {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.cell-mark--new {
  background: var(--color-new-bg);
  color: var(--color-new-fg);
}

.cell-mark--versionup {
  background: var(--color-versionup-bg);
  color: var(--color-versionup-fg);
}

.cell-mark--exclusive {
  background: var(--color-exclusive-bg);
  color: var(--color-exclusive-fg);
}

.cell-mark--included {
  background: var(--color-included-bg);
  color: var(--color-included-fg);
  font-size: 0.85rem;
}

.cell-mark--empty {
  color: #ccc;
}

/* Legend */
.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 12px 14px;
  background: var(--color-bg-soft);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--color-text-soft);
  align-items: center;
}

.matrix-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Buy / Paths buttons */
.edition-block-buy-btn,
.target-summary-buy-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 18px;
  background: #fff;
  color: var(--color-accent-dark);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.target-summary-buy-btn {
  background: var(--color-accent-dark);
  color: #fff;
}

.edition-block-buy-btn:hover,
.target-summary-buy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.edition-block-paths-btn,
.target-summary-paths-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.target-summary-paths-btn {
  color: var(--color-accent-dark);
  border-color: var(--color-accent-light);
  background: #fff;
}

.edition-block-paths-btn:hover,
.target-summary-paths-btn:hover {
  background: rgba(255,255,255,0.18);
}

.target-summary-paths-btn:hover {
  background: var(--color-accent-light);
}

/* Modal */
.paths-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.paths-modal[hidden] { display: none !important; }

.paths-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(34, 30, 70, 0.55);
  backdrop-filter: blur(2px);
}

.paths-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  z-index: 1;
}

.paths-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: #fff;
  border-radius: 12px 12px 0 0;
  z-index: 2;
}

.paths-modal-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-accent-dark);
}

.paths-modal-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--color-text-soft);
  padding: 0 8px;
  line-height: 1;
}

.paths-modal-close:hover { color: var(--color-text); }

.paths-modal-help {
  margin: 0;
  padding: 12px 22px;
  background: var(--color-bg-soft);
  font-size: 0.8rem;
  color: var(--color-text-soft);
  border-bottom: 1px solid var(--color-border);
}

.paths-list {
  list-style: none;
  margin: 0;
  padding: 12px 18px;
}

.path-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.path-item:hover {
  border-color: var(--color-accent-light);
  background: var(--color-bg-soft);
}

.path-item.is-eligible {
  border-color: var(--color-accent-dark);
  background: rgba(180, 188, 253, 0.12);
}

.path-rank {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  background: var(--color-accent-dark);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.path-main {
  flex: 1;
  min-width: 0;
}

.path-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.path-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent-dark);
}

.path-badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.path-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.path-badge--eligible {
  background: var(--color-accent-dark);
  color: #fff;
}

.path-badge--crossgrade {
  background: #f0c850;
  color: #5a4400;
}

.path-badge--msrp {
  background: var(--color-included-bg);
  color: var(--color-included-fg);
}

.path-product-name {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text);
  font-weight: 600;
}

.path-eligible-note {
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: var(--color-text-soft);
}

.path-action {
  flex: 0 0 auto;
}

.path-buy-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--color-accent-dark);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
}

.path-buy-btn:hover { background: #2e2570; }

.path-buy-btn.is-disabled {
  background: #aaa;
  pointer-events: none;
}

.paths-empty {
  text-align: center;
  padding: 24px;
  color: var(--color-text-soft);
}

/* Footer */
.footer-info {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  margin-top: 32px;
}

.data-meta {
  font-size: 0.8rem;
  color: var(--color-text-soft);
  margin: 0;
  line-height: 1.7;
}

.site-footer {
  background: var(--color-accent-dark);
  color: #fff;
  text-align: center;
  padding: 12px 0;
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--color-accent-light);
}
