/* 全体レイアウト */
body {
  margin: 0;
  padding: 0;
  background: #fff;
  font-family: "Yu Gothic", "YuGothic", sans-serif, "Meiryo UI", Meiryo;
  font-size: 16px;
  color: #333;
  line-height: 1.6;
}
.wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}
/* 本日分見出し */
.balloon-heading {
  position: relative;
  background: transparent;
  color: #494949;
  padding: 0.25em 0.5em;
  border-left: solid 5px #7db4e6;
  font-size: 28px;
  margin: 0 0 10px 0;
}
.balloon-heading:not(:first-of-type) {
  margin-top: 30px;
}
/* 吹き出し */
.balloon {
  display: inline-block;
  background: #f0f0f0;
  color: #333;
  padding: 8px 12px;
  border-radius: 12px;
  position: relative;
  margin: 10px 0 20px 0;
  font-size: 16px;
}
.balloon:before {
  content: "";
  position: absolute;
  top: 100%;
  left: 20px;
  border: 10px solid transparent;
  border-top-color: #f0f0f0;
}
/* 楽曲リスト */
ol.song-list,
.upcoming-song-list {
  padding: 0;
  list-style: none;
  margin: 10px 0;
}
ol.song-list li {
  position: relative;
  padding: 0.8em 1em;
  margin-bottom: 8px;
  background: #e6f4ff;
  color: #505050;
  border-radius: 15px 0 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.song-info {
  flex-grow: 1;
  margin-left: 1px;
}
.song-info a {
  text-decoration: none;
  color: #1e90ff;
  font-weight: bold;
}
.song-info small {
  display: block;
  color: #777;
  margin-top: 4px;
}
/* いいねボタン */
.like-button,
.share-button {
  background: #f0f8ff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
  margin-left: 10px;
  flex-shrink: 0;
}
.like-button.disabled {
  background: #eee;
  color: #999;
  cursor: default;
}
/* シェアボタン内アイコン */
.share-button img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}
/* 翌日セクション */
.upcoming-section {
  background: #fffbed;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.upcoming-heading {
  position: relative;
  padding: 0.5em;
  background: #ffe991;
  color: #333;
  font-size: 20px;
  margin: 0 0 20px 0;
  text-align: center;
  border-radius: 8px;
}
.upcoming-heading::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  border-bottom: solid 15px transparent;
  border-right: solid 20px #b2a58f;
}
.upcoming-song-list li {
  background: #f0f0f0;
  margin-bottom: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
}
.upcoming-song-list li a {
  text-decoration: none;
  color: #1e90ff;   /* 今日と同じリンクカラー */
}
.upcoming-title {
  font-size: 16px;
  padding: 0.25em 0.5em;
  margin: 5px 0 10px 0;
  color: #494949;
}
/* レスポンシブ */
@media (max-width: 768px) {
  .wrapper {
    padding: 12px;
    font-size: 15px;
  }
  .balloon-heading {
    font-size: 24px;
    padding: 0.25em 0.5em;
  }
  .upcoming-heading,
  .upcoming-title {
    font-size: 18px;
  }
}

/* NEWバッジ */
.new-badge{
  display:inline-block;
  font-size:12px;
  line-height:1;
  padding:4px 7px;
  border-radius:999px;
  background:#ff4d4f;
  color:#fff;
  font-weight:bold;
  margin-right:6px;
  vertical-align:middle;
}

/* ===== タブUI ===== */
.tab-wrap {
  margin: 0 0 18px 0;
}

.tab-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.tab-switch input {
  display: none;
}

.tab-switch label {
  position: relative;
  padding: 10px 14px;
  background: #fffbed;
  border: 1px solid #e6dca8;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  font-size: 15px;
  color: #333;
  line-height: 1;
  user-select: none;
  flex: 1;
  text-align: center;
}

.tab-switch label:hover {
  filter: brightness(0.98);
}

/* タブ全体は常に親幅いっぱい */
.tab-wrap,
.tab-switch,
.tab-panels,
.tab-panel {
  width: 100%;
  box-sizing: border-box;
}

/* flexの子要素が縮んで幅が変わるのを防ぐ */
.tab-panels {
  flex: 0 0 100%;
}

/* パネルが中身で横幅を変えないように */
.tab-panel {
  min-width: 0;
}

/* アクティブタブ */
.tab-switch input:checked + label {
  background: #ffe991;
  border-color: #e6dca8;
  font-weight: 700;
}

/* 吹き出し（三角）※ :hasを使わず実現 */
.tab-switch input:checked + label::before {
  content: "";
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 9px;
  background-color: #ffe991;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* パネル */
.tab-panels {
  background: #fff;
  padding-top: 14px;
}

/* デフォは非表示 */
.tab-panel {
  display: none;
}

/* panel2（記念日の楽曲検索）を中央寄せ＆幅安定 */
#panel2 #date-search {
  max-width: 720px;     /* 好みで調整 */
  margin: 0 auto;       /* パネル中央 */
}

/* ラジオで表示切替 */
#tab1:checked ~ .tab-panels #panel1,
#tab2:checked ~ .tab-panels #panel2,
#tab3:checked ~ .tab-panels #panel3 {
  display: block;
}

/* ③ キーワード検索 */
.kw-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px 0;
}
.kw-controls input[type="text"], .kw-controls select {
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}
.kw-controls input[type="text"] { flex: 1; min-width: 220px; }
.kw-controls select { width: 180px; }

.kw-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kw-item {
  background: #f0f0f0;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
}
.kw-meta {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}
.kw-song a {
  text-decoration: none;
  color: #1e90ff;
  font-weight: bold;
}
.kw-song small {
  display: block;
  color: #777;
  margin-top: 4px;
}

/* panel3（キーワード検索）を中央寄せ＆幅安定 */
#panel3 .kw-controls,
#panel3 .kw-list {
  max-width: 720px;   /* panel2 と揃える */
  margin-left: auto;
  margin-right: auto;
}

/* ③ キーワード検索：入力欄の×ボタン */
.kw-input-wrap{
  position: relative;
  flex: 1;
  min-width: 220px;
}

/* 検索用テキストボックス */
#kwInput {
    width: 90%;
    display: block !important;
    visibility: visible !important;
}

/* 左ドロップダウン（検索モード） */
#kwMode{
  width: 180px;
}
@media (max-width: 768px){
  #kwMode{ width: 150px; }
}