body {
  /*font-family: Arial, sans-serif;*/
  font-family: Klee One, sans-serif;
  font-weight: 600;
  font-size: 18px;
  /*line-height: 1.6;*/
  line-height: 2;
  margin: 20px;
}

.koda_bio_type,
.koda_bio_artist,
.koda_bio_target {
  display: none;
}

.koda_bio_info {
  font-family: Noto Sans JP, sans-serif;
  font-weight: 200;
  font-size: 12px;
  display: none;
}

.koda_bio_main {
  font-family: Klee One, sans-serif;
  font-weight: 600;
  font-size: 18px;
  /*line-height: 1.6;*/
  line-height: 2;
  margin: 20px;
  color: maroon;
}

.koda_bio_q {
  display: inline-block;
  width: 100%;
  height: auto;
  background-color: whitesmoke;
  padding: 10px;
  border-left: 4px solid silver;
  margin: 10px 0;
}

.koda_bio_speaker {
  font-family: Noto Sans JP, sans-serif;
  display: inline;
  font-weight: bold;
  color: maroon;
  margin: 5px 0;
}

.koda_bio_title {
  font-family: Noto Sans JP, sans-serif;
  font-weight: 200;
  font-size: 1.2em;
  /*font-weight: bold;*/
  color: #2e8b57;
  margin: 15px 0 10px 0;
  text-decoration: underline;
  text-underline-offset: 8px;
}

.koda_bio_source {
  font-family: Noto Sans JP, sans-serif;
  font-weight: 200;
  font-style: italic;
  /*font-weight: bold;*/
  color: #333;
  margin: 5px 0;
  float: right;
}

.koda_bio_source::after {
  content: " より";
}

/* 直前の安定表示に近づけるための最小スタイル */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* Tránh scroll của page */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo,
    sans-serif;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  overflow: hidden; /* Tránh scroll của main */
  display: flex;
  flex-direction: column;
  min-height: 0; /* Cho phép flex item shrink */
}
.header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
  border-bottom: 1px solid #ddd;
}
.header-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 8px 12px;
}
.site-title {
  font-size: 24px;
  margin: 0 12px 0 0;
}
.nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 12px;
}
.filter-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.compact-select select {
  padding: 4px 6px;
  height: 28px;
}
.load-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.timeline-container {
  display: flex;
  gap: 12px;
  height: 100%;
  padding: 8px 12px;
  overflow: hidden;
}

/* Decade bar container */
#timeline-bar-container {
  height: 100%;
  overflow: hidden auto;
  position: sticky;
  top: 0;
  padding: 0 10px;
  border-right: 1px solid #e0e0e0;
}

/* 左の年代レール用の退避スペースを確保 */
.timeline-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.timeline-right-tags {
  display: flex;
  gap: 6px;
  align-items: center;
}
.timeline-item {
  margin-bottom: 12px;
}
.timeline-date-badge {
  background: #2196f3;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.timeline-age-tag {
  background: #e91e63;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.timeline-category-tag {
  background: #4caf50;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}
/* ボックスの基本枠と優先度別色分け */
.timeline-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 12px;
}
/* 数値クラス（10:high, 20:mid, 30:low） */
.timeline-item.priority-10 .timeline-card {
  border-color: #ffe0b2 !important;
  border-width: 2px !important;
}
.timeline-item.priority-20 .timeline-card {
  border-color: #e1bee7 !important;
}
.timeline-item.priority-30 .timeline-card {
  border-color: #c8e6c9 !important;
}
.timeline-card.news-card {
  border-left: 6px solid #e91e63;
}
.timeline-detail-panel {
  margin-top: 8px;
  border-radius: 10px;
  background: #e6f3ff;
  padding: 8px;
  overflow: hidden;
}
.timeline-detail-panel > .detail-html-content {
  background: #fff !important;
  border-radius: 8px;
  padding: 12px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: auto;
  display: block;
}
.timeline-detail-panel > .detail-html-content * {
  background: transparent !important;
}
/* 写真エリア：固定サイズ＋角丸枠 */
.timeline-image {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  height: 400px;
  background: #fff;
  position: relative;
}
.timeline-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}
/* インライン・スライドショー（複数画像） */
.timeline-image.multi-image .inline-slideshow {
  position: relative;
  width: 100%;
  height: 100%;
}
.timeline-image.multi-image .inline-slides {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.timeline-image.multi-image .inline-slide {
  display: none;
  width: 100%;
  height: 100%;
}
.timeline-image.multi-image .inline-slide.active {
  display: block;
}
.timeline-image.multi-image .inline-nav {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: auto;
}
.timeline-image.multi-image .inline-nav-btn {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  border-radius: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.timeline-image.multi-image .inline-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.timeline-image.multi-image .inline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbb;
  cursor: pointer;
}
.timeline-image.multi-image .inline-dot.active {
  background: #fff;
}
.timeline-detail-panel .detail-html-content img,
.timeline-detail-panel .detail-html-content video,
.timeline-detail-panel .detail-html-content iframe,
.timeline-detail-panel .detail-html-content table {
  max-width: 100%;
  height: auto;
}

/* New Timeline Layout Styles - Based on Image Design */
.timeline-top-section {
  margin-bottom: 12px;
}
.timeline-dates-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.timeline-date-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}
.timeline-date-btn-blue {
  background: #2196f3;
  color: #fff;
}
.timeline-metadata-buttons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.timeline-meta-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}
.timeline-meta-btn-gray {
  background: #9e9e9e;
  color: #fff;
}
.timeline-meta-btn-red {
  background: #f44336;
  color: #fff;
}
.timeline-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.timeline-title-field {
  background: #c8e6c9;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  flex: 1;
  box-sizing: border-box;
}
.timeline-detail-icon,
.timeline-reference-icon-btn {
  font-size: 24px;
  cursor: pointer;
  flex-shrink: 0;
}
.timeline-detail-icon:hover,
.timeline-reference-icon-btn:hover {
  opacity: 0.7;
}

.timeline-middle-section {
  margin-bottom: 12px;
}
.timeline-content-wrapper {
  display: flex;
  gap: 16px;
}
.timeline-main-content {
  flex: 1;
}
.timeline-text-field {
  background: #c8e6c9;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  min-height: 60px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.timeline-association-group {
  margin-bottom: 12px;
}
.timeline-association-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}
.timeline-association-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.timeline-assoc-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}
.timeline-assoc-btn-gray {
  background: #9e9e9e;
  color: #fff;
}
.timeline-assoc-btn-lightblue {
  background: #81d4fa;
  color: #000;
}
.timeline-assoc-btn-pink {
  background: #f48fb1;
  color: #fff;
}

.timeline-other-associations {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.timeline-other-associations .timeline-association-group {
  margin-bottom: 0;
  width: 49%;
}

.timeline-sidebar {
  width: 200px;
  flex-shrink: 0;
}
.timeline-reference-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
}
.timeline-reference-icon {
  font-size: 24px;
  margin-bottom: 8px;
}
.timeline-reference-content {
  font-size: 12px;
}
.timeline-reference-item {
  margin-bottom: 6px;
  color: #666;
}
.timeline-reference-note {
  margin-top: 8px;
  font-size: 11px;
  color: #999;
  font-style: italic;
}

.timeline-bottom-section {
  width: 80%;
  justify-self: center;
  margin-top: 12px;
}
.timeline-photo-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}

/* Image Modal Popup Styles */
.image-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.image-modal .modal-content {
  position: relative;
  background-color: #fff;
  margin: 2% auto;
  padding: 0;
  border: none;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.image-modal .modal-close {
  color: #333;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.3s;
}

.image-modal .modal-close:hover {
  opacity: 0.7;
}

.image-modal .modal-header {
  padding: 20px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.image-modal .modal-title-wrap h3 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.image-modal .modal-date {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
}

.image-modal .slide-counter {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.image-modal .modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.image-modal .slideshow-container {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
}

.image-modal .modal-images {
  display: flex;
  transition: transform 0.3s ease;
  height: 100%;
}

.image-modal .modal-image {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal .modal-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.image-modal .slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 15px 20px;
  font-size: 24px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
  z-index: 1000;
}

.image-modal .slide-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.image-modal .slide-nav.prev {
  left: 20px;
}

.image-modal .slide-nav.next {
  right: 20px;
}

.image-modal .modal-caption {
  padding: 15px 20px;
  background: #f5f5f5;
  border-top: 1px solid #ddd;
}

.image-modal .modal-caption-text {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
}

.image-modal .modal-artists {
  font-size: 13px;
  color: #666;
}

.image-modal .slide-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  background: #f5f5f5;
}

.image-modal .slide-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background 0.3s;
}

.image-modal .slide-dots .dot.active {
  background: #2196f3;
}

.image-modal .slide-dots .dot:hover {
  background: #999;
}
.timeline-content {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  contain: strict;
}
#list {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
}
#list-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.decade-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin: 10px 0;
  padding: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 14px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.3);
  position: relative;
}

.decade-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.4);
}

.needle {
  position: absolute;
  width: 2px;
  background: rgba(99, 102, 241, 0.5);
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  height: 18px;
}

.year-icons-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(-14px);
  transition: all 0.3s ease;
}

.year-icon {
  width: 49px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  margin: 4px 0;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-14px);
  position: relative;
}

.year-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.lifesize-icon {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2d5016;
  border: 1px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  padding: 0;
  transition: transform 0.15s ease;
  z-index: 10;
}

.lifesize-label {
  position: fixed;
  top: 50%;
  left: calc(100% + 20px);
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(26, 54, 93, 0.95);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.2);
  display: none;
  z-index: 9999;
  pointer-events: auto;
}

.lifesize-arrow {
  position: absolute;
  top: 50%;
  left: -6px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid rgba(26, 54, 93, 0.95);
}