/* 日本のチェーン店 創立年タイムライン */

.cs-outer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.cs-intro {
  font-size: 1rem;
  line-height: 1.9;
  margin: 1.2rem 0;
  color: var(--c-ink);
}

.cs-disclaimer {
  font-size: 0.9rem;
  line-height: 1.8;
  background: #fbf6ed;
  border-left: 4px solid var(--c-ai-tetsu, #1f3a5f);
  padding: 0.8rem 1rem;
  margin: 1rem 0 1.5rem;
  color: #4a4a4a;
}

.cs-filters {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f7f3ea;
  border-radius: 4px;
}

.cs-filter-label {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0.5rem 0 0.4rem;
  color: var(--c-ink);
}

.cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0.8rem;
}

.cs-chip {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: #fff;
  border: 1.5px solid #cfc4ad;
  border-radius: 18px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #6a604c;
  transition: all 0.15s ease;
  user-select: none;
  font-family: 'Noto Sans JP', sans-serif;
}

.cs-chip:hover {
  border-color: var(--c-ai-tetsu, #1f3a5f);
}

.cs-chip.active {
  background: var(--c-ai-tetsu, #1f3a5f);
  color: #fbf6ed;
  border-color: var(--c-ai-tetsu, #1f3a5f);
}

.cs-year-slider {
  position: relative;
  height: 28px;
  margin: 0.4rem 0;
}

.cs-year-slider input[type="range"] {
  position: absolute;
  width: 100%;
  height: 4px;
  top: 12px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.cs-year-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--c-ai-tetsu, #1f3a5f);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
}

.cs-year-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--c-ai-tetsu, #1f3a5f);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  border: none;
}

.cs-year-slider::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 4px;
  top: 12px;
  background: #d4c8b3;
  border-radius: 2px;
}

.cs-gantt-wrap {
  margin: 1.5rem 0;
}

.cs-gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0 0.8rem;
  font-size: 0.85rem;
  color: var(--c-ink);
}

.cs-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.cs-legend-bar {
  display: inline-block;
  width: 22px;
  height: 12px;
  border-radius: 2px;
}

.cs-legend-active { background: var(--c-ai-tetsu, #1f3a5f); }
.cs-legend-defunct { background: #998774; }
.cs-legend-low {
  background: var(--c-ai-tetsu, #1f3a5f);
  background-image: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.5) 25%, rgba(255,255,255,0.5) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.5) 75%);
  background-size: 6px 6px;
}
.cs-legend-foreign {
  display: inline-block;
  width: 22px;
  height: 2px;
  border-top: 2px dashed #b04b3a;
}

.cs-gantt-scroll {
  overflow-x: auto;
  border: 1px solid #d4c8b3;
  background: #fbf6ed;
  border-radius: 4px;
}

#cs-gantt-svg {
  display: block;
  background: #fbf6ed;
}

.cs-gantt-bar {
  cursor: pointer;
  transition: opacity 0.15s;
}

.cs-gantt-bar:hover {
  opacity: 0.7;
}

.cs-gantt-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  fill: var(--c-ink, #2a2a2a);
  pointer-events: none;
}

.cs-gantt-category-label {
  font-family: 'Shippori Mincho', serif;
  font-size: 13px;
  font-weight: 500;
  fill: var(--c-ai-tetsu, #1f3a5f);
}

.cs-gantt-year-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  fill: #6a604c;
}

.cs-gantt-grid-line {
  stroke: #e0d6c0;
  stroke-width: 1;
}

.cs-gantt-grid-line.cs-grid-major {
  stroke: #c4b896;
  stroke-width: 1.2;
}

.cs-gantt-category-separator {
  stroke: #b8a988;
  stroke-width: 1;
  stroke-dasharray: 3,3;
}

.cs-gantt-foreign-line {
  stroke: #b04b3a;
  stroke-width: 1.5;
  stroke-dasharray: 4,3;
  fill: none;
  pointer-events: none;
}

.cs-gantt-foreign-marker {
  fill: #b04b3a;
}

/* tooltip */
.cs-gantt-tooltip {
  position: fixed;
  background: #2a2620;
  color: #fbf6ed;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 320px;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-family: 'Noto Sans JP', sans-serif;
}

.cs-gantt-tooltip-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: #ffe9a8;
}

.cs-gantt-tooltip-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.6rem;
  margin: 0.3rem 0;
  font-size: 0.78rem;
}

.cs-gantt-tooltip-key {
  color: #b8a988;
}

.cs-gantt-tooltip-note {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: #d4c8b3;
  font-style: italic;
}

.cs-gantt-tooltip-certainty {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
}

.cs-cert-high { background: #5d7a3f; color: #fbf6ed; }
.cs-cert-medium { background: #c4933f; color: #fbf6ed; }
.cs-cert-low { background: #b04b3a; color: #fbf6ed; }

/* 詳細パネル */
.cs-detail {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fbf6ed;
  border: 2px solid var(--c-ai-tetsu, #1f3a5f);
  border-radius: 6px;
  padding: 1.2rem 1.4rem 1rem;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.cs-detail-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6a604c;
  line-height: 1;
}

.cs-detail-close:hover {
  color: var(--c-aka, #b04b3a);
}

.cs-detail-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
  color: var(--c-ai-tetsu, #1f3a5f);
}

.cs-detail-category {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: var(--c-ai-tetsu, #1f3a5f);
  color: #fbf6ed;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-bottom: 0.6rem;
}

.cs-detail-table {
  width: 100%;
  margin: 0.5rem 0;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cs-detail-table th,
.cs-detail-table td {
  padding: 0.3rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #e0d6c0;
}

.cs-detail-table th {
  color: #6a604c;
  font-weight: 500;
  width: 35%;
}

.cs-detail-note {
  margin: 0.6rem 0;
  padding: 0.5rem 0.7rem;
  background: #f3ecdb;
  border-left: 3px solid #c4933f;
  font-size: 0.85rem;
  color: #4a4a4a;
  line-height: 1.6;
}

.cs-detail-link {
  display: inline-block;
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--c-ai-tetsu, #1f3a5f);
}

.cs-detail-link::after {
  content: ' ↗';
}

/* 解説節 */
.cs-h2 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.4rem;
  color: var(--c-ai-tetsu, #1f3a5f);
  margin: 2rem 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #d4c8b3;
}

.cs-h3 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.15rem;
  color: var(--c-ai-tetsu, #1f3a5f);
  margin: 1.4rem 0 0.6rem;
}

.cs-p {
  font-size: 0.95rem;
  line-height: 1.95;
  margin: 0.6rem 0;
  color: var(--c-ink, #2a2a2a);
}

.cs-rules-list {
  font-size: 0.95rem;
  line-height: 1.85;
  margin: 0.6rem 0 1.2rem;
  padding-left: 1.5rem;
  color: var(--c-ink, #2a2a2a);
}

.cs-rules-list li {
  margin: 0.4rem 0;
}

.cs-related {
  font-size: 0.95rem;
  line-height: 1.9;
  margin: 0.6rem 0 1.2rem;
  padding-left: 1.5rem;
}

.cs-note {
  font-size: 0.82rem;
  color: #6a604c;
  line-height: 1.7;
  margin: 1rem 0;
  padding: 0.6rem 0.8rem;
  background: #f3ecdb;
  border-radius: 4px;
}

/* レスポンシブ */
@media (max-width: 720px) {
  .cs-outer {
    padding: 0 0.6rem;
  }
  .cs-detail {
    width: calc(100vw - 24px);
    right: 12px;
    top: 12px;
  }
  #cs-gantt-svg {
    width: 1280px;
  }
}
