.seec-app-comparison {
  --seec-border: #e5e7eb;
  --seec-muted: #6b7280;
  --seec-bg: #f8fafc;
  --seec-accent: #e5486d;
  --seec-accent-dark: #bd3152;
  margin: 2rem 0;
  color: #1f2937;
}

.seec-comparison-title {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.seec-comparison-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--seec-border);
  border-radius: 12px;
  background: var(--seec-bg);
}

.seec-control {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

.seec-control input,
.seec-control select {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 14px;
}

.seec-reset {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  font-weight: 700;
}

.seec-reset:hover,
.seec-reset:focus-visible {
  border-color: #64748b;
}

/* こだわり条件のチェックボックス群 */
.seec-flags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}

.seec-flag-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.seec-flag-label:hover { border-color: #64748b; }

.seec-flag-label input { margin: 0; }

.seec-flag-label:has(input:checked) {
  border-color: var(--seec-accent);
  background: #fff1f5;
  color: var(--seec-accent-dark);
}

.seec-flag-label:focus-within {
  outline: 2px solid var(--seec-accent);
  outline-offset: 1px;
}

.seec-license {
  color: #94a3b8 !important;
  font-size: 10px !important;
  line-height: 1.45 !important;
  word-break: break-all;
}

.seec-result-count {
  margin: 10px 0 8px;
  color: var(--seec-muted);
  font-size: 13px;
}

.seec-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--seec-border);
  border-radius: 12px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.seec-comparison-table {
  width: 100%;
  min-width: 1080px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 14px;
}

.seec-comparison-table th,
.seec-comparison-table td {
  padding: 12px 10px;
  border: 0;
  border-right: 1px solid var(--seec-border);
  border-bottom: 1px solid var(--seec-border);
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
}

.seec-comparison-table th:last-child,
.seec-comparison-table td:last-child {
  border-right: 0;
}

.seec-comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.seec-comparison-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #111827;
  color: #fff;
  font-size: 12px;
}

.seec-comparison-table thead button {
  position: relative;
  width: 100%;
  padding: 0 18px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.seec-comparison-table thead button::after {
  content: "↕";
  position: absolute;
  right: 0;
  opacity: .6;
}

.seec-comparison-table thead th[aria-sort="ascending"] button::after { content: "↑"; opacity: 1; }
.seec-comparison-table thead th[aria-sort="descending"] button::after { content: "↓"; opacity: 1; }

.seec-comparison-table tbody tr:nth-child(even) { background: #fcfcfd; }
.seec-comparison-table tbody tr:hover { background: #fff7f9; }

.seec-comparison-table th:first-child,
.seec-comparison-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

.seec-comparison-table thead th:first-child { z-index: 3; }

/* 固定列（アプリ名）は横スクロール時に背景が透けないよう明示指定する */
.seec-comparison-table tbody tr td:first-child { background: #fff; }
.seec-comparison-table tbody tr:nth-child(even) td:first-child { background: #fcfcfd; }
.seec-comparison-table tbody tr:hover td:first-child { background: #fff7f9; }

.seec-comparison-table th:first-child,
.seec-comparison-table td:first-child {
  box-shadow: 3px 0 6px -3px rgba(15, 23, 42, 0.18);
}

.seec-rank {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  font-weight: 800;
}

.seec-app-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  white-space: normal;
}

.seec-app-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.seec-app-name {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.seec-app-cell small,
.seec-comparison-table td small {
  display: block;
  margin-top: 4px;
  color: var(--seec-muted);
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
}

.seec-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fce7f3;
  color: #9d174d;
  font-size: 10px;
  font-weight: 700;
}

.seec-score { font-size: 12px; }
.seec-score strong { font-size: 15px; }
.seec-score-empty,
.seec-link-empty { color: #94a3b8; font-size: 12px; }

.seec-cta {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--seec-accent);
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
}

.seec-cta:hover,
.seec-cta:focus-visible { background: var(--seec-accent-dark); }

/* 計測タグ（jsl-custom-label）でボタンを出力した場合の見え方を揃える */
.seec-app-comparison .jsl-custom-label { cursor: pointer; }

.seec-app-comparison .seec-cta.jump,
.seec-app-comparison .seec-cta.jump:hover {
  color: #fff !important;
  text-decoration: none !important;
}

.seec-app-comparison .jsl-custom-label:focus-visible {
  outline: 3px solid var(--seec-accent-dark);
  outline-offset: 2px;
}

.seec-cta-label { display: inline-block; }

/* 詳細列を廃止したぶん、アプリ名とロゴをリンクにしている */
.seec-app-logo-wrap { display: inline-block; line-height: 0; }

.seec-app-name {
  display: inline-block;
  color: var(--seec-accent-dark);
  cursor: pointer;
  text-decoration: none;
}

.seec-app-name strong { font-size: 15px; font-weight: 800; }

.seec-app-comparison .seec-app-name.jump,
.seec-app-comparison .seec-app-logo-wrap.jump {
  color: var(--seec-accent-dark) !important;
  text-decoration: none !important;
}

.seec-app-comparison .seec-app-name:hover strong { text-decoration: underline; }

.seec-recommended { max-width: 160px; }

.seec-comparison-note {
  margin: 10px 0 0;
  color: var(--seec-muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .seec-comparison-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .seec-flags { grid-column: 1 / -1; }
  .seec-search-control { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .seec-comparison-toolbar { grid-template-columns: 1fr; }
  .seec-search-control { grid-column: auto; }
  .seec-table-scroll { border-radius: 8px; }
  .seec-comparison-table { min-width: 940px; font-size: 13px; }
  .seec-comparison-table th,
  .seec-comparison-table td { padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .seec-app-comparison * { scroll-behavior: auto !important; }
}
