/* LiDARカタログ スタイルシート */

:root {
  --bg: #f0f4ff;
  --bg-strong: #e5ecff;
  --surface: #ffffff;
  --surface-soft: #f7faff;
  --surface-border: #c8d4ec;
  --text-main: #0f1e38;
  --text-sub: #4d5f7a;
  --accent: #0d5fd8;
  --accent-soft: #dce8ff;
  --scan-bg: #eef4ff;
  --scan-fg: #1a4a9e;
  --cat-auto-long-bg: #d4edff;
  --cat-auto-long-fg: #0a3d6e;
  --cat-auto-short-bg: #e0f0ff;
  --cat-auto-short-fg: #1a4d7a;
  --cat-industrial-bg: #e8f0fe;
  --cat-industrial-fg: #2a3d6a;
  --cat-robotics-bg: #d8f5e8;
  --cat-robotics-fg: #0a3d1e;
  --cat-research-bg: #fff8d4;
  --cat-research-fg: #4a3500;
  --cat-software-bg: #f0e8ff;
  --cat-software-fg: #3a1a6a;
  --discontinued-bg: #f0f0f4;
  --discontinued-fg: #5a6070;
  --wave-1550-bg: #fff0e8;
  --wave-1550-fg: #6a2a00;
  --shadow-low: 0 2px 8px rgba(15, 30, 56, 0.08);
  --shadow-mid: 0 8px 24px rgba(15, 30, 56, 0.14);
  --topbar-height: 68px;
  --nav-height: 44px;
  --header-total: calc(var(--topbar-height) + var(--nav-height));
  --left-panel-width: 340px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1522;
    --bg-strong: #162035;
    --surface: #172030;
    --surface-soft: #1c2840;
    --surface-border: #2f4262;
    --text-main: #e8f0ff;
    --text-sub: #b0c2de;
    --accent: #8ab4ff;
    --accent-soft: #1e3560;
    --scan-bg: #1e2a4a;
    --scan-fg: #8ab4ff;
    --cat-auto-long-bg: #153050;
    --cat-auto-long-fg: #90caff;
    --cat-auto-short-bg: #152840;
    --cat-auto-short-fg: #80bcff;
    --cat-industrial-bg: #1a2240;
    --cat-industrial-fg: #90a8ff;
    --cat-robotics-bg: #0f2f20;
    --cat-robotics-fg: #80e8b0;
    --cat-research-bg: #3a3010;
    --cat-research-fg: #ffe080;
    --cat-software-bg: #2a1840;
    --cat-software-fg: #c090ff;
    --discontinued-bg: #252835;
    --discontinued-fg: #8090a8;
    --wave-1550-bg: #3a2010;
    --wave-1550-fg: #ffb070;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: "M PLUS 1p", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(1100px 380px at 10% -15%, color-mix(in srgb, var(--accent) 14%, transparent), transparent),
    radial-gradient(800px 280px at 95% -8%, color-mix(in srgb, #24a1ff 10%, transparent), transparent),
    var(--bg);
  overflow: hidden;
}

/* ── トップバー ── */
.top-app-bar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
}

.top-app-bar__content {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.top-app-bar__back {
  width: 40px; height: 40px;
  border-radius: 999px;
  display: grid; place-items: center;
  color: var(--text-sub);
  text-decoration: none;
}

.top-app-bar__back:hover {
  background: color-mix(in srgb, var(--text-main) 8%, transparent);
}

.top-app-bar__icon { color: var(--accent); }

.top-app-bar__title-wrap { min-width: 0; }

.top-app-bar__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.top-app-bar__subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-sub);
}

/* ── ナビゲーションタブ ── */
.top-app-bar {
  display: flex;
  flex-direction: column;
  height: auto;
}

.top-app-bar__content {
  height: var(--topbar-height);
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  height: var(--nav-height);
  border-top: 1px solid var(--surface-border);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 8px;
  gap: 2px;
  flex-shrink: 0;
}

.main-nav::-webkit-scrollbar { display: none; }

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 36px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 120ms, color 120ms;
  flex-shrink: 0;
}

.nav-tab .material-symbols-outlined { font-size: 16px; }

.nav-tab:hover {
  background: color-mix(in srgb, var(--text-main) 7%, transparent);
  color: var(--text-main);
}

.nav-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── レイアウト ── */
.app-layout {
  height: calc(100dvh - var(--header-total));
  display: grid;
  grid-template-columns: minmax(244px, 316px) minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
}

/* ── コントロールパネル ── */
.control-panel {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: var(--shadow-low);
}

.panel-header {
  padding: 12px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.panel-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.panel-scroll {
  overflow-y: auto;
  padding-bottom: 12px;
  flex: 1;
  min-height: 0;
}

/* ── 検索ボックス ── */
.quick-search {
  margin: 0 12px 8px;
  height: 38px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0 9px;
  background: var(--surface-soft);
  color: var(--text-sub);
  flex-shrink: 0;
}

.quick-search input {
  border: none; outline: none;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 12px;
}

/* ── フィルタブロック ── */
.filter-block { padding: 8px 12px 0; }

.filter-block__title {
  font-size: 10px;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.filter-block--checkbox { padding-top: 12px; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.chip-group, .active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip-button {
  font: inherit;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  color: var(--text-sub);
  padding: 5px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.chip-button.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--surface-border));
}

.ghost-button {
  font: inherit;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 12px;
}

.ghost-button:hover { border-color: var(--accent); color: var(--accent); }

.filter-select {
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-main);
  height: 36px;
  padding: 0 10px;
  outline: none;
}

.filter-select:focus { border-color: var(--accent); }

.control-panel .chip-button {
  font-size: 11px;
  padding: 4px 8px;
  gap: 4px;
}

.country-flag-btn {
  font-size: 18px;
  padding: 2px 4px;
  line-height: 1;
}

.control-panel .ghost-button {
  font-size: 11px;
  padding: 5px 9px;
}

.control-panel .filter-select--facet {
  width: 100%;
  font-size: 11px;
  height: 32px;
  border-radius: 9px;
}

.range-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.range-control__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-sub);
}

.range-control__slider-shell {
  position: relative;
  height: 36px;
}

.range-control__slider-shell::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-border) 88%, transparent);
}

.range-control__track,
.range-control__fill {
  position: absolute;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
}

.range-control__track {
  left: 2px;
  right: 2px;
  background: color-mix(in srgb, var(--surface-border) 88%, transparent);
}

.range-control__fill {
  background: color-mix(in srgb, var(--accent) 40%, transparent);
}

.range-thumb {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(15, 30, 56, 0.2);
  transform: translate(-50%, calc(-50% + var(--thumb-offset, 0px)));
  z-index: 2;
  cursor: grab;
}

.range-thumb:active {
  cursor: grabbing;
}

.range-thumb--min {
  --thumb-offset: -10px;
}

.range-thumb--max {
  --thumb-offset: 10px;
}

.range-thumb:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, white);
  outline-offset: 2px;
}

.range-control__scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  line-height: 1.2;
  color: var(--text-sub);
}

.range-control__scale span {
  white-space: nowrap;
}

.filter-builder__toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 6px;
}

.filter-builder {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-builder__empty {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.5;
  border: 1px dashed var(--surface-border);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-soft);
}

.filter-rule {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 8px;
}

.filter-rule__row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.85fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.filter-rule__row .filter-select {
  width: 100%;
  min-width: 0;
}

.filter-rule__value--static {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  color: var(--text-sub);
  border: 1px dashed var(--surface-border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.filter-rule__number {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.filter-rule__unit {
  font-size: 10px;
  color: var(--text-sub);
  flex-shrink: 0;
}

.filter-rule__remove {
  white-space: nowrap;
}

@media (max-width: 960px) {
  .filter-rule__row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .filter-rule__remove {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* ── カタログメインエリア ── */
.catalog-stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
}

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.catalog-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog-stats__total {
  font-size: 12px;
  color: var(--text-sub);
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-row label {
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
}

.count-pill {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.active-filters { flex-shrink: 0; }

.active-filter-chip {
  font: inherit;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--surface-border));
  background: var(--surface-soft);
  color: var(--text-main);
  padding: 5px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.empty-hint {
  font-size: 12px;
  color: var(--text-sub);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed var(--surface-border);
}

/* ── LiDARカードグリッド ── */
.lidar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 16px;
  align-content: start;
}

.lidar-card {
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: background 160ms, border-color 160ms, transform 160ms, box-shadow 160ms;
  box-shadow: var(--shadow-low);
}

.lidar-card:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--surface-border));
  transform: translateY(-2px);
  box-shadow: var(--shadow-mid);
}

.lidar-card.active {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 60%, var(--surface-border));
  transform: translateY(-2px);
  box-shadow: var(--shadow-mid);
}

.lidar-card.discontinued { opacity: 0.7; }

.lidar-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.lidar-card__name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.lidar-card__manufacturer {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 2px;
}

.lidar-card__badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.lidar-card__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.spec-item {
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 6px 8px;
}

.spec-item__label {
  font-size: 9px;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.spec-item__value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.spec-item__unit {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-sub);
}

.spec-item--na .spec-item__value {
  color: var(--text-sub);
  font-weight: 400;
  font-size: 11px;
}

/* ── バッジ ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.badge--cat-auto-long  { background: var(--cat-auto-long-bg);  color: var(--cat-auto-long-fg);  }
.badge--cat-auto-short { background: var(--cat-auto-short-bg); color: var(--cat-auto-short-fg); }
.badge--cat-industrial { background: var(--cat-industrial-bg); color: var(--cat-industrial-fg); }
.badge--cat-robotics   { background: var(--cat-robotics-bg);   color: var(--cat-robotics-fg);   }
.badge--cat-research   { background: var(--cat-research-bg);   color: var(--cat-research-fg);   }
.badge--cat-software   { background: var(--cat-software-bg);   color: var(--cat-software-fg);   }

.badge--scan {
  background: var(--scan-bg);
  color: var(--scan-fg);
}

.badge--wave-1550 {
  background: var(--wave-1550-bg);
  color: var(--wave-1550-fg);
}

.badge--discontinued {
  background: var(--discontinued-bg);
  color: var(--discontinued-fg);
}

/* ── 詳細ドロワー ── */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.detail-overlay:not([hidden]) { pointer-events: auto; }

.detail-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  opacity: 0;
  transition: opacity 250ms ease;
}

.detail-overlay:not([hidden])::before { opacity: 1; }

.detail-panel {
  position: relative;
  width: min(600px, 100vw);
  height: 100%;
  background: var(--surface);
  transform: translateX(100%);
  transition: transform 250ms ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-mid);
}

.detail-overlay:not([hidden]) .detail-panel { transform: translateX(0); }

.detail-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--surface-border);
  flex-shrink: 0;
}

.detail-panel__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.detail-panel__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
}

.detail-panel__subtitle {
  margin: 4px 0 0;
  color: var(--text-sub);
  font-size: 12px;
}

.icon-button {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  flex-shrink: 0;
  display: grid; place-items: center;
}

.icon-button:hover { background: color-mix(in srgb, var(--text-main) 9%, transparent); }

.detail-panel__body {
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 詳細セクション */
.detail-section { display: flex; flex-direction: column; gap: 10px; }

.detail-section__title {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.detail-section__title .material-symbols-outlined { font-size: 15px; }

/* スペックテーブル */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.specs-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--surface-border);
}

.specs-table td { padding: 7px 6px; vertical-align: top; }

.specs-table td:first-child {
  width: 45%;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
}

.specs-table td:last-child { font-size: 13px; }

.spec-na { color: var(--text-sub); font-style: italic; font-size: 12px; }

.spec-note { font-size: 11px; color: var(--text-sub); display: block; margin-top: 1px; }

/* ref上付き文字 */
.ref-sup {
  display: inline-flex;
  gap: 2px;
  margin-left: 2px;
  font-size: 10px;
}

.ref-sup a {
  border-radius: 4px;
  text-decoration: none;
  padding: 1px 3px;
  color: var(--accent);
  background: var(--accent-soft);
}

/* 参考文献リスト */
.references-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reference-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 10px;
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
}

.reference-item__num {
  text-align: center;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  padding-top: 1px;
}

.reference-item__title {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  line-height: 1.4;
}

.reference-item__title:hover { text-decoration: underline; }

.reference-item__meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-sub);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.src-type-badge {
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

/* ── 廃番・注意情報 ── */
.discontinued-notice {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--discontinued-bg);
  color: var(--discontinued-fg);
  font-size: 12px;
  border: 1px solid color-mix(in srgb, var(--discontinued-fg) 20%, transparent);
}

/* ── エンティティビュー共通 ── */
.entity-view {
  height: calc(100dvh - var(--header-total));
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 14px;
  overflow: hidden;
}

.entity-view__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.entity-view__header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  overflow-y: auto;
  align-content: start;
  padding-bottom: 16px;
}

.entity-card {
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 160ms, border-color 160ms, transform 160ms, box-shadow 160ms;
  box-shadow: var(--shadow-low);
}

.entity-card:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--surface-border));
  transform: translateY(-2px);
  box-shadow: var(--shadow-mid);
}

.entity-card__icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

.entity-card__icon .material-symbols-outlined { font-size: 20px; }

.entity-card__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.entity-card__name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.entity-card__name-sub {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 1px;
}

.entity-card__country {
  font-size: 20px;
  line-height: 1;
}

.entity-card__desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entity-card__stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.entity-card__stat {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-sub);
  border: 1px solid var(--surface-border);
}

.entity-card__stat strong {
  color: var(--accent);
}

.entity-card__pros {
  font-size: 11px;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entity-card__pros span::before {
  content: "✓ ";
  color: var(--cat-robotics-fg);
  font-weight: 700;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ── エンティティ詳細ページ ── */
.entity-detail {
  height: calc(100dvh - var(--header-total));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.entity-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--surface-border);
}

.entity-detail__back:hover { text-decoration: underline; }
.entity-detail__back .material-symbols-outlined { font-size: 18px; }

.entity-detail__body {
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.entity-detail__hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.entity-detail__hero-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

.entity-detail__hero-icon .material-symbols-outlined { font-size: 28px; }

.entity-detail__hero-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.entity-detail__hero-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-sub);
}

.entity-detail__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entity-detail__section-title {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.entity-detail__section-title .material-symbols-outlined { font-size: 15px; }

.entity-detail__desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-main);
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pros-cons__col {
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pros-cons__col--pros {
  background: color-mix(in srgb, var(--cat-robotics-bg) 60%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-robotics-fg) 20%, transparent);
}

.pros-cons__col--cons {
  background: color-mix(in srgb, var(--wave-1550-bg) 50%, transparent);
  border: 1px solid color-mix(in srgb, var(--wave-1550-fg) 20%, transparent);
}

.pros-cons__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pros-cons__col--pros .pros-cons__label { color: var(--cat-robotics-fg); }
.pros-cons__col--cons .pros-cons__label { color: var(--wave-1550-fg); }

.pros-cons__item {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.45;
  padding-left: 14px;
  position: relative;
}

.pros-cons__item::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--text-sub);
}

.entity-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.entity-link:hover { text-decoration: underline; }

.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entity-view__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entity-view__section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.entity-view__section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.entity-view__section-title {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.entity-view__section-title .material-symbols-outlined {
  font-size: 15px;
}

.entity-view__section-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-sub);
}

.parameter-group-block {
  padding-bottom: 6px;
}

.parameter-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.parameter-card__icon {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-soft));
}

.parameter-card .entity-card__desc {
  min-height: 3.1em;
}

.parameter-list-page .entity-detail__body,
.parameter-detail .entity-detail__body {
  gap: 20px;
}

.parameter-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.parameter-facet-hint {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-sub);
  font-size: 12px;
}

.parameter-facet-hint span {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
}

.parameter-detail__summary {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
  gap: 12px;
}

.parameter-detail__summary-text,
.parameter-detail__summary-note {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.parameter-detail__summary-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.6;
}

.parameter-detail__summary-note strong {
  color: var(--text-main);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.parameter-detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.parameter-facet-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.parameter-facet-switcher__btn {
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  color: var(--text-sub);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.parameter-facet-switcher__btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--surface-border));
}

.parameter-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.parameter-chart__bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 220px;
}

.parameter-chart__bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.parameter-chart__bar {
  min-height: 42px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.parameter-chart__stack {
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
}

.parameter-chart__segment {
  min-height: 2px;
}

.parameter-chart__bar-label {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-sub);
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.parameter-chart__bar-label--text {
  -webkit-line-clamp: 3;
}

.parameter-chart__bar-count {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
}

.parameter-chart__axis {
  font-size: 11px;
  color: var(--text-sub);
}

.parameter-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.parameter-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  font-size: 11px;
  color: var(--text-sub);
}

.parameter-chart__legend-item strong {
  color: var(--text-main);
}

.parameter-chart__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.parameter-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.parameter-summary-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.parameter-summary-card span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-sub);
}

.parameter-summary-card strong {
  font-size: 14px;
  color: var(--text-main);
}

.parameter-summary-card--wide {
  grid-column: span 2;
}

.parameter-empty {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed var(--surface-border);
  color: var(--text-sub);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  font-size: 13px;
}

.spec-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.spec-link:hover {
  text-decoration: underline;
}

/* 分布バーチャート */
.distribution-bar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.distribution-bar-item {
  display: grid;
  grid-template-columns: 120px 1fr 32px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.distribution-bar-item__label {
  color: var(--text-sub);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.distribution-bar-item__bar-wrap {
  height: 8px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
}

.distribution-bar-item__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 400ms ease;
  min-width: 2px;
}

.distribution-bar-item__count {
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

/* ── 2D比較ビュー ── */
.compare-view {
  height: calc(100dvh - var(--header-total));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.compare-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--surface-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.compare-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.compare-control-group label {
  color: var(--text-sub);
  font-weight: 700;
  white-space: nowrap;
}

.compare-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.compare-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.compare-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: var(--shadow-mid);
  max-width: 200px;
  z-index: 20;
  opacity: 0;
  transition: opacity 100ms;
}

.compare-tooltip.visible { opacity: 1; }

.compare-tooltip__name {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
}

.compare-tooltip__mfr {
  color: var(--text-sub);
  margin-bottom: 4px;
}

.compare-tooltip__vals {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--surface-border);
  flex-shrink: 0;
  font-size: 11px;
}

.compare-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.compare-legend-item__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── グラフビュー ── */
.graph-view {
  height: calc(100dvh - var(--header-total));
  display: flex;
  overflow: hidden;
}

.graph-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.graph-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.graph-canvas-wrap canvas:active { cursor: grabbing; }

.graph-controls {
  width: 220px;
  flex-shrink: 0;
  border-left: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 14px;
  gap: 16px;
}

.graph-controls__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.graph-controls__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.graph-control-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
}

.graph-control-label input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--accent);
}

.graph-control-label input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.graph-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.graph-legend-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.graph-hint {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.5;
}

.graph-controls__reset-btn {
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-sub);
  padding: 6px 10px;
  cursor: pointer;
  text-align: center;
}

.graph-controls__reset-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ── フッター注記 ── */
.data-disclaimer {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 56;
  margin: 0;
  max-width: min(600px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text-sub);
  font-size: 11px;
  line-height: 1.45;
  box-shadow: var(--shadow-low);
}

/* ── モバイルドック ── */
.mobile-dock { display: none; }

/* ── レスポンシブ ── */
@media (max-width: 900px) {
  .app-layout {
    display: block;
    height: calc(100dvh - var(--header-total));
    padding: 0;
  }

  .entity-view,
  .entity-detail,
  .compare-view,
  .graph-view {
    height: calc(100dvh - var(--header-total));
  }

  .parameter-detail__summary {
    grid-template-columns: 1fr;
  }

  .parameter-summary-card--wide {
    grid-column: span 1;
  }

  .graph-view {
    flex-direction: column;
  }

  .graph-controls {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--surface-border);
    max-height: 200px;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }

  .graph-controls__group { flex-direction: row; flex-wrap: wrap; }

  .catalog-stage {
    height: 100%;
    padding: 10px;
    overflow: hidden;
  }

  .control-panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: min(74dvh, 680px);
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    transform: translateY(calc(100% - 64px));
    transition: transform 230ms ease;
    z-index: 45;
  }

  body.mobile-panel-filters .control-panel { transform: translateY(0); }

  .mobile-dock {
    position: fixed;
    left: 10px; right: 10px; bottom: 10px;
    z-index: 55;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--surface-border);
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    box-shadow: var(--shadow-low);
  }

  .mobile-dock button {
    border: none;
    border-radius: 10px;
    height: 40px;
    font: inherit;
    font-size: 12px;
    background: transparent;
    color: var(--text-sub);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .mobile-dock button.active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .data-disclaimer {
    left: 10px; right: 10px;
    bottom: 68px;
    max-width: none;
    font-size: 10px;
  }

  .pros-cons { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .lidar-grid { grid-template-columns: 1fr; }
  .entity-grid { grid-template-columns: 1fr; }

  .detail-panel { width: 100vw; }

  .detail-panel__header,
  .detail-panel__body { padding-left: 14px; padding-right: 14px; }

  .nav-tab__label { display: none; }
  .nav-tab { padding: 0 10px; }

  .parameter-chart__bars {
    min-height: 180px;
  }
}
