@import url('root.css');

/******************************************************/

body {
  background-color: var(--pink);
}

.dot-background {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 5px, transparent 5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 5px, transparent 5px);
  background-position: 0 0, 15px 30px;
  background-size: 30px 60px;
}

h1 {
  font-family: var(--font-dot);
  transform: scaleY(0.7);
  letter-spacing: 0.1em;
  font-size: 40px;
  color: var(--violet);
  width: 100%;
  text-align: center;
  margin-bottom: 1em;
  padding-top: 0.25em;
  font-weight: bold;
}

/* ロゴ画像（テーマ別切り替え） */
h1.site-logo {
  transform: none;
  font-size: 0;
  height: 150px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  margin: 20px 0 30px;
}

body.theme-pink   h1.site-logo { background-image: url('../images/logo-1.png'); }
body.theme-purple h1.site-logo { background-image: url('../images/logo-2.png'); }
body.theme-mint   h1.site-logo { background-image: url('../images/logo-3.png'); }

/* =====================================================
   セレクトコンテナ
   PC: 最大4列 / スマホ: 1列
===================================================== */
#select_container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

@media (min-width: 1100px) {
  #select_container {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 575px) {
  #select_container {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   選択ボックス
===================================================== */
.select_box {
  font-weight: 800;
  background-color: var(--sakura);
  border-radius: 15px;
  padding: 1em;
  padding-top: 1.5em;
  position: relative;
  width: 100%;
}

.select_title {
  position: absolute;
  top: -0.75em;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--blue);
  width: 220px;
  max-width: calc(100% - 5rem);
  padding: 0.4em 1em 0.4em 0.9em;
  border-radius: 20px;
  color: #fff;
  letter-spacing: 1px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  box-sizing: border-box;
}

/* ユニット選択ボタン */
.unit_select_btn {
  background: none;
  border: none;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: var(--font-basic);
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: normal;
  word-break: break-all;
  text-align: center;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  line-height: 1.2;
}

.unit_select_btn::after {
  content: '▼';
  font-size: 0.6em;
  opacity: 0.75;
  flex-shrink: 0;
}

.unit_select_btn.selected {
  color: #fff;
}

.box_container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.box_item {
  background-color: #fff;
  position: relative;
  margin-top: 0.8em;
  padding: 0.75em 1em 0.75em 1.5em;
  border-radius: 10px;
}

.box_item_point {
  position: absolute;
  top: -0.5em;
  left: -1em;
  width: 45px;
  height: 45px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 48 C265 48, 271 53, 275 61 L315 147 L408 158 C418 159, 424 168, 421 177 C420 181, 418 185, 414 189 L344 257 L361 352 C363 362, 353 370, 343 366 L256 318 L169 366 C159 370, 149 362, 151 352 L168 257 L98 189 C91 181, 94 167, 104 158 L197 147 L237 61 C241 53, 247 48, 256 48 Z' fill='%23PLACEHOLDER' stroke='%23PLACEHOLDER' stroke-width='16' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  text-align: center;
  line-height: 40px;
  font-weight: bold;
  color: #fff;
  font-size: 15px;
  z-index: 2;
}

/* 曲select */
.song_select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-family: var(--font-basic);
  cursor: pointer;
  outline: none;
  color: #333;
}

.song_select:disabled {
  color: #bbb;
  cursor: not-allowed;
}

.b3st_select {
  width: 100%;
}

/* =====================================================
   ＋追加ボタン
===================================================== */
.add_btn_area {
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 8rem;
}

.btn_add_text {
  background: var(--dark-violet);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.55em 2.2em;
  min-width: 180px;
  font-size: 1rem;
  font-weight: bold;
  font-family: var(--font-basic);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.05em;
}

.btn_add_text:hover {
  background: var(--dark-perple);
  transform: scale(1.03);
}

/* =====================================================
   右下固定ボタン（カラーピッカー・保存）
===================================================== */
.submit_btn {
  position: fixed;
  bottom: 1em;
  right: 1em;
  z-index: 100;
  display: flex;
  flex-direction: row;
  gap: 0.6em;
}

.btn {
  border-radius: 50%;
  width: 2em;
  height: 2em;
  font-size: 1.8em;
  color: #fff;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
}
.btn:hover { opacity: 0.85; transform: scale(1.08); }

.btn i { color: #fff; }

.btn_submit {
  background-color: var(--dark-perple);
}

.btn_submit:hover {
  background-color: var(--hover-perple);
  color: #fff;
}

body.theme-pink   .btn_submit { background-color: #9f7aea; }
body.theme-pink   .btn_submit:hover { background-color: #b794f4; }
body.theme-purple .btn_submit { background-color: #6b7280; }
body.theme-purple .btn_submit:hover { background-color: #9ca3af; }
body.theme-mint   .btn_submit { background-color: #e8890a; }
body.theme-mint   .btn_submit:hover { background-color: #f5a030; }

.btn_colorpicker {
  background-color: var(--dark-blue);
}

.btn_colorpicker:hover {
  background-color: var(--hover-blue);
  color: #fff;
}

/* =====================================================
   カラーモーダル（既存）
===================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.color-palette {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

/* =====================================================
   ユニット選択モーダル
===================================================== */
.unit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.unit-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.unit-modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem;
  width: 92%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.unit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--pink);
}

body.theme-pink   .unit-modal-header { border-bottom-color: #ffb3d9; }
body.theme-purple .unit-modal-header { border-bottom-color: #c4b5fd; }
body.theme-mint   .unit-modal-header { border-bottom-color: #6ae8c2; }

.unit-modal-header h3 {
  font-family: var(--font-dot);
  color: var(--dark-violet);
  margin: 0;
  font-size: 1rem;
  transform: scaleY(0.85);
}

.unit-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 50%;
  transition: background 0.15s;
}

.unit-modal-close:hover {
  background: #f0f0f0;
  color: #555;
}

/* 事務所グループ */
.agency-group {
  margin-bottom: 1.2rem;
}

.agency-label {
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--dark-violet);
  margin-bottom: 0.45rem;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

/* ユニットボタングリッド */
.unit-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.unit-btn {
  background: var(--dark-violet);
  border: none;
  border-radius: 20px;
  padding: 0.35em 0.85em;
  font-size: 0.82rem;
  font-weight: bold;
  font-family: var(--font-basic);
  cursor: pointer;
  transition: all 0.15s;
  color: #fff;
  line-height: 1.4;
}

.unit-btn:hover {
  background: var(--dark-perple);
  color: #fff;
}

.unit-btn.selected {
  background: #5c3db8;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
}

/* テーマ別 ユニット選択中カラー */
body.theme-pink   .unit-btn.selected { background: #e8528a; box-shadow: 0 0 0 3px rgba(255,255,255,0.6); }
body.theme-purple .unit-btn.selected { background: #7b5cff; box-shadow: 0 0 0 3px rgba(255,255,255,0.6); }
body.theme-mint   .unit-btn.selected { background: #12a07a; box-shadow: 0 0 0 3px rgba(255,255,255,0.6); }

/* =====================================================
   過去のデータボタン（右下固定）
===================================================== */
.btn_mydata {
  background-color: var(--dark-blue);
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn_mydata:hover {
  background-color: var(--hover-blue);
}

/* =====================================================
   保存結果モーダル
===================================================== */
.save-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.save-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.save-modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  width: 92%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.save-modal-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.save-check {
  background: var(--dark-violet);
  color: #fff;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.save-modal-header h3 {
  font-family: var(--font-dot);
  color: var(--dark-violet);
  margin: 0;
  font-size: 1.1rem;
  transform: scaleY(0.85);
}

.save-token-area {
  background: var(--save-block-bg, #f0ecff);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.save-token-label {
  font-size: 0.72rem;
  color: #888;
  white-space: nowrap;
}

.save-token-value {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.2em;
  color: var(--save-token-color, #5c3db8);
  flex: 1;
}

.save-token-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark-violet);
  font-size: 1.1rem;
  padding: 0.3rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.save-token-copy:hover {
  background: var(--save-copy-hover, #e0d8ff);
}

.save-token-note {
  font-size: 0.78rem;
  color: #888;
  margin: 0 0 1.2rem;
  line-height: 1.6;
}

.save-email-section {
  border-top: 1px solid #eee;
  padding-top: 1rem;
  margin-bottom: 1.2rem;
}

.save-email-desc {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 0.6rem;
}

.save-email-row {
  display: flex;
  gap: 0.5rem;
}

.save-email-input {
  flex: 1;
  border: 1.5px solid #d0c8ff;
  border-radius: 10px;
  padding: 0.5em 0.8em;
  font-size: 0.85rem;
  font-family: var(--font-basic);
  outline: none;
  transition: border-color 0.15s;
}

.save-email-input:focus {
  border-color: var(--dark-violet);
}

.save-email-btn {
  background: var(--dark-violet);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.5em 1.2em;
  font-size: 0.85rem;
  font-family: var(--font-basic);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.save-email-btn:hover {
  background: var(--dark-perple);
}

.save-email-error {
  color: #e74c3c;
  font-size: 0.78rem;
  margin-top: 0.4rem;
}

.save-email-success {
  color: #27ae60;
  font-size: 0.85rem;
  font-weight: bold;
  margin-top: 0.5rem;
}

.save-sns-area {
  margin: 0.8rem 0 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--save-divider, #ecdff8);
}
.save-sns-btns {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}
.save-sns-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.4em 1em;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  cursor: pointer;
}
.save-sns-btn:hover { opacity: 0.85; transform: scale(1.03); }
.save-sns-line  { background: #06c755; color: #fff; }
.save-sns-x     { background: #000; color: #fff; }
.save-sns-mail  { background: #6c757d; color: #fff; }

.save-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.save-history-link {
  font-size: 0.82rem;
  color: var(--dark-violet);
  text-decoration: underline;
}

.save-history-link:hover {
  color: var(--dark-perple);
}

.save-close-btn {
  background: #eee;
  border: none;
  border-radius: 10px;
  padding: 0.5em 1.4em;
  font-size: 0.85rem;
  font-family: var(--font-basic);
  cursor: pointer;
  transition: background 0.15s;
}

.save-close-btn:hover {
  background: #ddd;
}

/* =====================================================
   テーマ（共通ベース追加スタイル）
===================================================== */
body {
  transition: background 0.35s ease;
}

.select_box {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.select_box:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.song_select {
  border-radius: 10px;
  transition: background 0.2s;
}

.song_select:focus {
  box-shadow: 0 0 0 3px rgba(150, 150, 255, 0.2);
}

/* =====================================================
   PINK THEME
===================================================== */
body.theme-pink {
  --violet:       #ff8ac2;
  --dark-violet:  #ff6fa5;
  --hover-perple: #ffb3d9;
  --dark-perple:  #ff8ac2;
  --blue:         #ffb3d9;
  --dark-blue:    #ff6fa5;
  --hover-blue:   #ffd6ec;
  --sakura:       rgba(255, 255, 255, 0.65);
  --save-block-bg:    #fff0f7;
  --save-token-color: #c0527c;
  --save-input-border: #ffb3d9;
  --save-copy-hover:  #ffe0ef;
  --save-divider:     #ffd6ec;
  background-color: #ffd6ec;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 5px, transparent 5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 5px, transparent 5px),
    linear-gradient(135deg, #ffe2e4 0%, #f7d9ff 50%, #cfd1ff 100%);
  background-attachment: fixed;
  background-position: 0 0, 15px 22px, 0 0;
  background-size: 30px 44px, 30px 44px, 100% 100%;
}

body.theme-pink .select_box {
  box-shadow: 0 10px 30px rgba(255, 100, 160, 0.1);
  backdrop-filter: blur(10px);
}

body.theme-pink h1 {
  text-shadow: 0 0 12px rgba(255, 150, 200, 0.5);
}

body.theme-pink .btn_add_text {
  background: linear-gradient(135deg, #ff8ac2, #ffb3d9);
  box-shadow: 0 5px 15px rgba(255, 138, 194, 0.4);
}

body.theme-pink .btn_add_text:hover {
  background: linear-gradient(135deg, #ff6fa5, #ff8ac2);
}

body.theme-pink .song_select:not(:disabled) {
  background: #fff0f7;
  color: #c0527c;
}

/* =====================================================
   PURPLE THEME
===================================================== */
body.theme-purple {
  --violet:       #9f7aea;
  --dark-violet:  #7b5cff;
  --hover-perple: #b794f4;
  --dark-perple:  #9f7aea;
  --blue:         #c4b5fd;
  --dark-blue:    #9f7aea;
  --hover-blue:   #e6dcff;
  --sakura:       rgba(255, 255, 255, 0.72);
  --save-block-bg:    #f3f0ff;
  --save-token-color: #5c3db8;
  --save-input-border: #c4b3f7;
  --save-copy-hover:  #e0d8ff;
  --save-divider:     #ecdff8;
  background-color: #ffffff;
  background-image:
    linear-gradient(rgba(180, 160, 255, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 160, 255, 0.25) 1px, transparent 1px);
  background-size: 17px 17px;
}

body.theme-purple .select_box {
  border: 1px solid rgba(160, 140, 255, 0.18);
  box-shadow: 0 10px 30px rgba(140, 120, 255, 0.08);
}

body.theme-purple h1 {
  text-shadow: 0 0 14px rgba(150, 130, 255, 0.5);
}

body.theme-purple .btn_add_text {
  background: linear-gradient(135deg, #9f7aea, #b794f4);
  box-shadow: 0 8px 20px rgba(140, 120, 255, 0.4);
}

body.theme-purple .btn_add_text:hover {
  background: linear-gradient(135deg, #7b5cff, #9f7aea);
}

body.theme-purple .song_select:not(:disabled) {
  background: #f3f0ff;
  color: #6f42c1;
}

/* =====================================================
   MINT THEME
===================================================== */
body.theme-mint {
  --violet:       #38d9a9;
  --dark-violet:  #12b886;
  --hover-perple: #63e6be;
  --dark-perple:  #38d9a9;
  --blue:         #6ae8c2;
  --dark-blue:    #38d9a9;
  --hover-blue:   #dff7f5;
  --sakura:       rgba(255, 255, 255, 0.85);
  --save-block-bg:    #eafff9;
  --save-token-color: #0ca678;
  --save-input-border: #6ae8c2;
  --save-copy-hover:  #d0fff3;
  --save-divider:     #b2f2e0;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #e1fff7 25%, transparent 25%),
    linear-gradient(315deg, #e1fff7 25%, #ffffff 25%);
  background-attachment: fixed;
  background-position: 10px 0, 0 0;
  background-size: 20px 20px;
  background-repeat: repeat;
}

body.theme-mint .select_box {
  border: 1px solid rgba(0, 180, 160, 0.12);
  box-shadow: 0 10px 30px rgba(0, 200, 160, 0.08);
}

body.theme-mint h1 {
  letter-spacing: 0.08em;
}

body.theme-mint .btn_add_text {
  background: linear-gradient(135deg, #38d9a9, #63e6be);
  box-shadow: 0 6px 18px rgba(0, 200, 160, 0.35);
}

body.theme-mint .btn_add_text:hover {
  background: linear-gradient(135deg, #12b886, #38d9a9);
}

body.theme-mint .song_select:not(:disabled) {
  background: #eafff9;
  color: #0ca678;
}

/* =====================================================
   テーマピッカーモーダル
===================================================== */
.theme-picker-modal {
  background: #fff;
  border-radius: 24px;
  padding: 2rem 2rem 1.5rem;
  width: 92%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.theme-picker-title {
  font-family: var(--font-dot);
  font-size: 1rem;
  color: var(--dark-violet);
  transform: scaleY(0.85);
  margin-bottom: 1.5rem;
}

.theme-picker-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: nowrap;
}

@media (max-width: 400px) {
  .theme-picker-grid { gap: 0.5rem; }
  .theme-picker-modal { padding: 1.5rem 1rem 1.2rem; }
}

.theme-card {
  background: none;
  border: 2.5px solid transparent;
  border-radius: 16px;
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100px;
}

@media (max-width: 400px) {
  .theme-card { width: 80px; padding: 0.3rem; }
  .theme-preview { width: 66px; height: 76px; }
}

.theme-card:hover {
  transform: translateY(-3px);
}

.theme-card.theme-card-active {
  border-color: var(--dark-violet);
}

/* プレビュー共通 */
.theme-preview {
  width: 80px;
  height: 90px;
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  /* スマホ幅対応: カード幅に追従 */
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
}

.theme-preview-bar {
  width: 60%;
  height: 10px;
  border-radius: 6px;
  margin-bottom: 0.2rem;
}

.theme-preview-card {
  background: rgba(255,255,255,0.85);
  border-radius: 8px;
  width: 100%;
  flex: 1;
  padding: 0.35rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.theme-preview-pill {
  height: 9px;
  border-radius: 6px;
  width: 70%;
  align-self: center;
}

.theme-preview-line {
  height: 7px;
  border-radius: 4px;
  background: rgba(0,0,0,0.08);
  width: 100%;
}

.theme-preview-line.short {
  width: 65%;
}

/* Pink プレビュー */
.theme-preview-pink {
  background: linear-gradient(160deg, #ffd6ec, #ffeaf6);
}
.theme-preview-pink .theme-preview-bar { background: #ffb3d9; }
.theme-preview-pink .theme-preview-pill { background: #ff8ac2; }

/* Purple プレビュー */
.theme-preview-purple {
  background: linear-gradient(160deg, #e6dcff, #f3efff);
}
.theme-preview-purple .theme-preview-bar { background: #c4b5fd; }
.theme-preview-purple .theme-preview-pill { background: #9f7aea; }

/* Mint プレビュー */
.theme-preview-mint {
  background: linear-gradient(160deg, #dff7f5, #f0fffd);
}
.theme-preview-mint .theme-preview-bar { background: #96f2d7; }
.theme-preview-mint .theme-preview-pill { background: #38d9a9; }

.theme-label {
  font-size: 0.78rem;
  font-weight: bold;
  color: #666;
  letter-spacing: 0.05em;
}

.theme-close-btn {
  background: #eee;
  border: none;
  border-radius: 10px;
  padding: 0.5em 1.8em;
  font-size: 0.85rem;
  font-family: var(--font-basic);
  cursor: pointer;
  transition: background 0.15s;
}

.theme-close-btn:hover {
  background: #ddd;
}

/* =====================================================
   ドラッグハンドル
===================================================== */
/* × 削除ボタン */
.box-remove-btn {
  position: absolute;
  top: 0.4rem;
  left: 0.55rem;
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 3;
  transition: color 0.15s;
}

.box-remove-btn:hover {
  color: rgba(180, 0, 0, 0.55);
}

/* ♡ 最推しハートボタン（select_title の左端からはみ出す配置） */
.fav-heart-btn {
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  border: 2.5px solid var(--blue);
  background: #fff;
  color: #ccc;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -1.5em;
  margin-right: 0.4em;
  transition: color 0.15s, transform 0.15s, border-color 0.15s;
}
.fav-heart-btn:hover {
  color: #ffb3d9;
  transform: scale(1.12);
}
.fav-heart-btn.fav-active {
  color: #ff3d7f;
  border-color: #ff3d7f;
}
/* テーマ別：アクティブ時は同じフラミンゴピンク */
body.theme-pink   .fav-heart-btn.fav-active,
body.theme-purple .fav-heart-btn.fav-active,
body.theme-mint   .fav-heart-btn.fav-active {
  color: #ff3d7f;
  border-color: #ff3d7f;
}

.drag-handle {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  color: rgba(0, 0, 0, 0.18);
  cursor: grab;
  font-size: 0.85rem;
  z-index: 3;
  line-height: 1;
  transition: color 0.15s;
}

.drag-handle:hover {
  color: rgba(0, 0, 0, 0.4);
}

.drag-handle:active {
  cursor: grabbing;
}

.sortable-ghost {
  opacity: 0.35;
}

.sortable-chosen {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  transform: scale(1.02);
}

/* =====================================================
   シェアバッジ
===================================================== */
.share-badge {
  display: inline-block;
  background: var(--dark-violet);
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.15em 0.6em;
  border-radius: 10px;
  margin-left: 0.5rem;
  vertical-align: middle;
  letter-spacing: 0.04em;
}

/* 保存モーダル内シェアURL */
.save-share-area {
  background: var(--save-block-bg, #f0ecff);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1rem;
}

.save-share-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.3rem;
}

.save-share-input {
  flex: 1;
  border: 1.5px solid var(--save-input-border, #d0c8ff);
  border-radius: 8px;
  padding: 0.4em 0.7em;
  font-size: 0.78rem;
  font-family: monospace;
  color: var(--save-token-color, #5c3db8);
  background: #fff;
  outline: none;
  min-width: 0;
}

.save-share-note {
  font-size: 0.72rem;
  color: #888;
  margin: 0;
  line-height: 1.5;
}

/* 履歴ページのシェアURL */
.history-share-box {
  background: #f0ecff;
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.history-share-label {
  font-size: 0.72rem;
  color: #888;
  font-weight: bold;
}

.history-share-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.3rem;
}

.history-share-input {
  flex: 1;
  border: 1.5px solid #d0c8ff;
  border-radius: 8px;
  padding: 0.4em 0.7em;
  font-size: 0.78rem;
  font-family: monospace;
  color: #5c3db8;
  background: #fff;
  outline: none;
  min-width: 0;
}

.history-share-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark-violet);
  font-size: 1rem;
  padding: 0.3rem;
  border-radius: 6px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.history-share-copy:hover {
  background: #e0d8ff;
}

.history-share-note {
  font-size: 0.72rem;
  color: #888;
  margin: 0;
  line-height: 1.5;
}

/* =====================================================
   マイデータページ
===================================================== */
.mydata-wrap {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.mydata-card {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.mydata-title {
  font-family: var(--font-dot);
  color: var(--dark-violet);
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  transform: scaleY(0.85);
  display: block;
}

.mydata-desc {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.7;
  margin-bottom: 1.4rem;
}

.mydata-error {
  background: #fef0f0;
  border: 1px solid #f5c6cb;
  color: #e74c3c;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.mydata-field {
  margin-bottom: 1.2rem;
}

.mydata-label {
  display: block;
  font-size: 0.8rem;
  font-weight: bold;
  color: #555;
  margin-bottom: 0.4rem;
}

.mydata-input {
  width: 100%;
  border: 1.5px solid #d0c8ff;
  border-radius: 10px;
  padding: 0.65em 1em;
  font-size: 0.95rem;
  font-family: var(--font-basic);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.mydata-input:focus {
  border-color: var(--dark-violet);
}

.mydata-btn {
  display: inline-block;
  background: var(--dark-violet);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.65em 2.4em;
  font-size: 0.95rem;
  font-family: var(--font-basic);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.mydata-btn:hover {
  background: var(--dark-perple);
  color: #fff;
}

.mydata-back {
  margin-top: 1.4rem;
  text-align: center;
  font-size: 0.82rem;
}

.mydata-back a {
  color: var(--dark-violet);
  text-decoration: underline;
}

/* =====================================================
   保存データ履歴ページ
===================================================== */
.history-meta {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #666;
}

.history-token-label {
  font-weight: bold;
  color: #555;
}

.history-token-value {
  font-family: monospace;
  font-size: 1rem;
  color: #5c3db8;
  font-weight: bold;
  letter-spacing: 0.1em;
}

.history-email {
  color: #999;
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

.history-empty {
  text-align: center;
  color: #aaa;
  padding: 3rem 0;
  font-size: 0.9rem;
}

.history-entry {
  margin-bottom: 2rem;
  background: #fff;
  border-radius: 16px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.history-entry-date {
  font-size: 0.75rem;
  color: #aaa;
  margin-bottom: 0.8rem;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.history-box {
  background: var(--sakura);
  border-radius: 12px;
  padding: 0.8rem 1rem;
}

.history-box-fav {
  border: 2px solid #e8226a;
  box-shadow: 0 0 0 3px rgba(232, 34, 106, 0.12);
}

.fav-badge {
  color: #e8226a;
  margin-right: 0.3em;
  font-size: 1em;
}

.history-unit-name {
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--dark-violet);
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(148, 127, 240, 0.2);
}

.history-song-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.history-song-num {
  background: var(--dark-violet);
  color: #fff;
  border-radius: 50%;
  width: 1.3em;
  height: 1.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: bold;
  flex-shrink: 0;
}

.history-song-title {
  font-size: 0.82rem;
  color: #444;
}

.history-actions {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 3rem;
}

/* =====================================================
   レスポンシブ調整
===================================================== */
/* スマホ右下常設FABボタン */
.sp-fab {
  display: none;
}

@media (max-width: 600px) {
  .sp-fab {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    position: fixed;
    bottom: 1.2rem;
    right: 1rem;
    z-index: 200;
  }
  .sp-fab .btn {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  }
}

/* 保存ボタン（＋追加の下） */
.inline-save-btn {
  display: block;
  margin: 0.7rem auto 0;
  padding: 0.55em 2.2em;
  min-width: 180px;
  border: none;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: bold;
  font-family: var(--font-basic);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s, transform 0.1s;
}
.inline-save-btn:hover { transform: scale(1.03); }
body.theme-pink   .inline-save-btn { background: #9f7aea; color: #fff; box-shadow: 0 5px 15px rgba(159,122,234,0.4); }
body.theme-pink   .inline-save-btn:hover { background: #b794f4; }
body.theme-purple .inline-save-btn { background: #6b7280; color: #fff; box-shadow: 0 5px 15px rgba(107,114,128,0.4); }
body.theme-purple .inline-save-btn:hover { background: #9ca3af; }
body.theme-mint   .inline-save-btn { background: #e8890a; color: #fff; box-shadow: 0 5px 15px rgba(232,137,10,0.4); }
body.theme-mint   .inline-save-btn:hover { background: #f5a030; }

@media (max-width: 600px) {
  /* スマホでは固定ボタン群を非表示、ハンバーガーメニューに切り替え */
  .submit_btn {
    display: none;
  }

  .save-modal-content {
    padding: 1.5rem;
  }

  .save-token-value {
    font-size: 1.2rem;
  }

  .history-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   比較ページ
===================================================== */

/* フォーム部分 */
.cmp-form-wrap {
  background: #fff;
  border-radius: 16px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.cmp-token-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cmp-token-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cmp-token-label {
  background: var(--dark-violet);
  color: #fff;
  border-radius: 50%;
  width: 1.6em;
  height: 1.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: bold;
  flex-shrink: 0;
}

.cmp-token-input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid #d0c8ff;
  border-radius: 10px;
  padding: 0.45em 0.7em;
  font-size: 0.85rem;
  font-family: monospace;
  letter-spacing: 0.06em;
  outline: none;
  transition: border-color 0.15s;
  text-transform: uppercase;
}

.cmp-token-input:focus {
  border-color: var(--dark-violet);
}

.cmp-submit-wrap {
  text-align: center;
}

/* 結果テーブル */
.cmp-result-wrap {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.cmp-table {
  min-width: calc(var(--cmp-cols, 1) * 200px);
}

/* ヘッダー行・ユニット行 共通グリッド */
.cmp-header-row,
.cmp-unit-row {
  display: grid;
  grid-template-columns: repeat(var(--cmp-cols, 1), minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: stretch;
}

/* ヘッダーセル */
.cmp-header-cell {
  background: var(--dark-violet);
  color: #fff;
  border-radius: 12px;
  padding: 0.6rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.cmp-header-cell.cmp-header-error {
  background: #ccc;
}

.cmp-header-token {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: bold;
  letter-spacing: 0.1em;
}

.cmp-badge {
  font-size: 0.65rem;
  font-weight: bold;
  padding: 0.1em 0.5em;
  border-radius: 8px;
}

.cmp-badge-error { background: #e74c3c; color: #fff; }
.cmp-badge-warn  { background: #f39c12; color: #fff; }

/* ユニットセル */
.cmp-unit-cell {
  display: flex;
  flex-direction: column;
}

/* データあり */
.cmp-unit-box {
  flex: 1;
  background: var(--sakura);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cmp-unit-name {
  font-weight: bold;
  font-size: 0.82rem;
  color: var(--dark-violet);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(148, 127, 240, 0.25);
  margin-bottom: 0.2rem;
}

.cmp-song-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.18rem 0;
}

.cmp-song-num {
  background: var(--dark-violet);
  color: #fff;
  border-radius: 50%;
  width: 1.3em;
  height: 1.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: bold;
  flex-shrink: 0;
}

.cmp-song-title {
  font-size: 0.78rem;
  color: #444;
  line-height: 1.3;
}

/* データなし：空セル */
.cmp-unit-empty {
  flex: 1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.3);
  border: 2px dashed rgba(148, 127, 240, 0.2);
  min-height: 80px;
}

.cmp-no-data {
  text-align: center;
  color: #aaa;
  padding: 2rem 0;
  font-size: 0.9rem;
}

/* トップページボタン（固定ボタンエリア） */
.btn_top {
  background-color: var(--dark-violet);
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn_top:hover {
  background-color: var(--hover-violet);
}

body.theme-pink   .btn_top:hover { background-color: var(--hover-perple); }
body.theme-purple .btn_top:hover { background-color: var(--hover-perple); }
body.theme-mint   .btn_top:hover { background-color: var(--hover-perple); }

/* 比較ボタン（固定ボタンエリア） */
.btn_compare {
  background-color: var(--dark-violet);
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn_compare:hover {
  background-color: var(--hover-perple);
}

/* ランキングボタン（固定ボタンエリア） */
.btn_ranking {
  background-color: var(--dark-violet);
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn_ranking:hover {
  background-color: var(--hover-perple);
}

@media (max-width: 600px) {
  .cmp-token-inputs {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   横スクロールヒント
===================================================== */
.scroll-hint-wrap {
  position: relative;
}

.scroll-hint {
  display: none;
  text-align: center;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 8px 8px 0 0;
  font-size: 0.75rem;
  color: #fff;
  letter-spacing: 0.05em;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.scroll-hint.is-fading {
  opacity: 0;
}

@media (max-width: 768px) {
  .scroll-hint {
    display: block;
  }
}

/* =====================================================
   ハンバーガーメニュー（スマホ専用）
===================================================== */
.hbg-btn {
  display: none;
  position: fixed;
  top: 0.8em;
  right: 0.9em;
  z-index: 300;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(160,100,200,0.25);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  transition: background 0.2s;
}

.hbg-btn .hbg-line {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--hbg-line-color, #947ff0);
  transition: transform 0.3s, opacity 0.2s, width 0.3s;
  transform-origin: center;
}

/* テーマ別ハンバーガー線色 */
body.theme-pink   { --hbg-line-color: #ff6fa5; }
body.theme-purple { --hbg-line-color: #9f7aea; }
body.theme-mint   { --hbg-line-color: #12b886; }

/* × 状態 */
.hbg-btn.is-open .hbg-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hbg-btn.is-open .hbg-line:nth-child(2) { opacity: 0; width: 0; }
.hbg-btn.is-open .hbg-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* オーバーレイ（メニュー展開時はページ全体を半透明黒でカバー） */
.hbg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  transition: opacity 0.25s;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.hbg-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* メニューパネル */
.hbg-menu {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 250;
  padding: 4.5rem 1.4rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  pointer-events: none;
  background: transparent;
  border-radius: 0 0 0 20px;
  min-width: 120px;
  transition: background 0.25s;
}
.hbg-menu.is-open {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  pointer-events: none; /* アイテム個別でautoにする */
}

.hbg-menu .hbg-item {
  display: flex;
  align-items: center;
  gap: 0.7em;
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
}

.hbg-menu.is-open .hbg-item {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hbg-menu.is-open .hbg-item:nth-child(1) { transition-delay: 0.04s; }
.hbg-menu.is-open .hbg-item:nth-child(2) { transition-delay: 0.09s; }
.hbg-menu.is-open .hbg-item:nth-child(3) { transition-delay: 0.14s; }
.hbg-menu.is-open .hbg-item:nth-child(4) { transition-delay: 0.19s; }

.hbg-menu .hbg-item .btn {
  font-size: 1.5em;
  box-shadow: 0 4px 14px rgba(160,100,200,0.3);
}

.hbg-menu .hbg-item-label {
  font-size: 0.82rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .hbg-btn { display: flex; }
}

/* =====================================================
   ユニット選択モーダル — プリセットセクション
===================================================== */
.unit-modal-preset {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0 0.8rem;
}

.unit-modal-preset-label {
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--dark-violet);
  opacity: 0.6;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.unit-preset-btn {
  background: linear-gradient(135deg, var(--dark-violet), var(--dark-perple));
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.4em 1.2em;
  font-size: 0.82rem;
  font-weight: bold;
  font-family: var(--font-basic);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.unit-preset-btn:hover {
  opacity: 0.88;
  transform: scale(1.03);
}

body.theme-pink   .unit-preset-btn { background: #9f7aea; box-shadow: 0 4px 12px rgba(159,122,234,0.35); }
body.theme-pink   .unit-preset-btn:hover { background: #b794f4; opacity: 1; }
body.theme-purple .unit-preset-btn { background: #6b7280; box-shadow: 0 4px 12px rgba(107,114,128,0.35); }
body.theme-purple .unit-preset-btn:hover { background: #9ca3af; opacity: 1; }
body.theme-mint   .unit-preset-btn { background: #e8890a; box-shadow: 0 4px 12px rgba(232,137,10,0.35); }
body.theme-mint   .unit-preset-btn:hover { background: #f5a030; opacity: 1; }

.unit-modal-divider {
  border: none;
  border-top: 1.5px solid rgba(183, 148, 244, 0.2);
  margin: 0 0 1rem;
}

/* =====================================================
   曲選択カスタムUI
===================================================== */
/* ネイティブselectを非表示 */
.song-select-hidden {
  display: none !important;
}

/* 曲選択ボタン */
.song-custom-btn {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 0.88rem;
  font-family: var(--font-basic);
  cursor: pointer;
  color: #bbb;
  text-align: left;
  padding: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.song-custom-btn.has-value {
  color: #333;
}
.song-custom-btn:disabled,
.song-custom-btn[disabled] {
  cursor: not-allowed;
  color: #ddd;
}
.song-custom-btn::after {
  content: ' ▾';
  font-size: 0.7em;
  opacity: 0.5;
}

/* 曲選択モーダル */
.song-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
}
.song-modal-overlay.visible {
  display: flex;
}

.song-modal-content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(120, 80, 200, 0.25);
  display: flex;
  flex-direction: column;
  width: min(480px, 94vw);
  max-height: 80vh;
  overflow: hidden;
}

.song-modal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(183, 148, 244, 0.2);
  flex-shrink: 0;
}

.song-dd-search {
  flex: 1;
  border: 1.5px solid #e0d8ff;
  border-radius: 8px;
  padding: 0.35em 0.7em;
  font-size: 0.82rem;
  font-family: var(--font-basic);
  outline: none;
  transition: border-color 0.15s;
}
.song-dd-search:focus {
  border-color: var(--dark-violet);
}

.song-modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #aaa;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}
.song-modal-close:hover {
  background: #f0f0f0;
  color: #555;
}

.song-dd-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}

.song-dd-item {
  padding: 0.5em 1rem;
  font-size: 0.84rem;
  cursor: pointer;
  color: #444;
  transition: background 0.12s;
  line-height: 1.4;
}
.song-dd-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4em 0.5rem 0.4em 1rem;
}
.song-dd-row-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.song-dd-item:hover {
  background: rgba(183, 148, 244, 0.12);
}
.song-dd-item.selected {
  color: var(--dark-violet);
  font-weight: bold;
  background: rgba(183, 148, 244, 0.08);
}
.song-dd-item.disabled {
  color: #ccc;
  cursor: not-allowed;
}
.song-dd-item.disabled .song-dd-play-btn {
  cursor: pointer;
  color: var(--violet, #b794f4);
  opacity: 0.7;
}
.song-dd-clear {
  color: #aaa;
  font-style: italic;
  border-bottom: 1px solid rgba(183, 148, 244, 0.1);
  margin-bottom: 0.2rem;
}
.song-dd-clear:hover {
  background: rgba(0,0,0,0.03);
}

/* オフィスグループのユニット見出し */
.song-dd-unit-heading {
  padding: 0.35em 1rem 0.25em;
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--dark-violet);
  opacity: 0.7;
  background: rgba(183, 148, 244, 0.07);
  cursor: default;
  pointer-events: none;
  letter-spacing: 0.03em;
}

/* 再生ボタン */
.song-dd-play-btn {
  flex-shrink: 0;
  background: none;
  border: 1.5px solid var(--violet, #b794f4);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--violet, #b794f4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.song-dd-play-btn:hover {
  background: var(--violet, #b794f4);
  color: #fff;
}

/* YouTubeプレビューモーダル */
.song-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1600;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
}
.song-preview-overlay.visible {
  display: flex;
}

.song-preview-content {
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  width: min(600px, 95vw);
  display: flex;
  flex-direction: column;
}

.song-preview-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #1a1a1a;
}

.song-preview-title-text {
  flex: 1;
  color: #eee;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-preview-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}
.song-preview-close:hover {
  color: #fff;
}


.song-preview-player {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}
.song-preview-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* =====================================================
   サイトフッター
===================================================== */
.site-footer {
  text-align: center;
  padding: 1.2rem 1rem 2rem;
  font-size: 0.78rem;
  color: #aaa;
}
.site-footer-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(255,255,255,0.5);
  border-radius: 20px;
  padding: 0.4em 1.2em;
}
.site-footer-sep { color: #ccc; }
.site-footer-link {
  color: var(--dark-violet);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.15s;
}
.site-footer-link:hover { opacity: 0.7; }
