/* =============================================
   play_mode
   ============================================= */
.play_mode {
  /*position: absolute;*/
  /*right: 0;*/
  /*bottom: 346px;*/
  /*width: 320px;*/
  /*background: #fff;*/
  /*padding: 16px;*/
  /*border: 1px solid rgba(0, 0, 0, 0.12);*/
  /*border-radius: 10px;*/
  /*box-shadow: 0 8px 24px rgba(0, 0, 0, 0.40);*/
  padding-bottom: 32px;
}

.play_mode h2 {
  font-size: 14px;
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.play_mode h2 button {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.play_mode h2 button svg {
  width: 24px;
  height: 24px;
}

.play_mode .mode_list {
  display: flex;
  gap: 6px;
}

.play_mode .mode_list .item {
  flex: 1;
  list-style: none;
}

.play_mode .mode_list .item a {
  display: block;
  text-align: center;
  padding: 9px 0;
  background: #f4f5f7;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
          background 0.12s,
          color 0.12s;
}

.play_mode .mode_list .item.on a {
  border: 2px solid #7e6ada;
  background: #fff;
  color: #7e6ada;
  font-weight: 600;
}

/* =============================================
   공통 - 페이지 헤더
   ============================================= */
.page-header {
  height: 56px;
  font-size: 18px;
  font-weight: 700;
  line-height: 140%;
  display: flex;
  align-items: center;
  padding: 0 15px 0 20px;
  border-bottom: 1px solid #e0e0e0;
}

.page-header button {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* channel_edit - 편집 헤더 */
.page-header.edit-header {
  padding: 0 15px;
}

.page-header.edit-header .btn-back {
  flex-shrink: 0;
}

.page-header.edit-header .header-title {
  font-size: 18px;
  font-weight: 700;
}

.page-header.edit-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.page-header.edit-header .header-actions button {
  width: auto;
  height: 36px;
  padding: 0 14px;
}

.page-header.edit-header .header-actions .btn-reset {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #444;
  cursor: pointer;
}

.page-header.edit-header .header-actions .btn-save {
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  cursor: pointer;
}

/* =============================================
   channel_mode - 스케줄 모드
   ============================================= */

.channel-contents {
  height: 100%;
  overflow-y: scroll;
}
.mode_schedule {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px 20px 0;
}

.mode_schedule .content-title {
  padding: 10px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mode_schedule .content-title .title-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode_schedule .content-title .title-text .title {
  font-size: 16px;
  font-weight: 600;
  line-height: 140%;
}

.mode_schedule .content-title .title-text .desc {
  font-size: 14px;
  font-weight: 500;
  line-height: 140%;
  color: var(--text-secondary);
}

.mode_schedule .content-title .tgl_wrap {
  width: auto;
}

.mode_schedule .btn-edit {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 15px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
}

.mode_schedule .btn-edit a {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   channel_mix - 채널믹스
   ============================================= */
.mix-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mix-tabs {
  display: flex;
  position: relative;
  padding: 20px 0;
}

.mix-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.mix-tab-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: rgba(126, 106, 218, 0.1);
  color: var(--color-accent);
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.mix-tab-bar {
  width: 100%;
  height: 5px;
  background: #e0e0e0;
  position: relative;
}

/* 채널 색상 클래스 — mix-tab-item, schedule-item 등에 추가해서 사용 */
.ch-1 {
  --ch-color: #7e6ada;
}
.ch-2 {
  --ch-color: #7e6ada;
  opacity: 0.75;
}
.ch-3 {
  --ch-color: #7e6ada;
  opacity: 0.5;
}

.mix-tab-bar {
  background: var(--ch-color, #e0e0e0);
}

.mix-tab-bar::before {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  bottom: 0;
  left: 0;
  width: 1px;
  height: 12px;
  background: #7e6ada;
  opacity: 0.5;
}

.mix-tab-item:last-child .mix-tab-bar::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  bottom: 0;
  right: 0;
  width: 1px;
  height: 12px;
  background: #7e6ada;
  opacity: 0.5;
}

.mix-tab-section {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ---- 막대그래프 비율 (채널 개수와 무관하게 동일 class 사용, 삭제 시 자동으로 100% 채움) ---- */

/* 균등 분배: 채널이 2개든 3개든 flex:1로 동일하게 나뉨 */
.mix-tabs.ratio-equal .mix-tab-item {
  flex: 1 1 0%;
}

/* 메인/보조 분배: 채널별 비율은 mix-tab-item에 style="--ratio:N"으로 지정 */
.mix-tabs.ratio-main .mix-tab-item {
  flex: var(--ratio, 1) 1 0%;
}

.mix-channel-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mix-channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mix-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ch-color, #e0e0e0);
}

.mix-channel-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.mix-empty-state {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 8px;
  height: 160px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mix-empty-state p {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 140%;
  margin: 0;
}

/* =============================================
   channel_mix_edit - 채널믹스 편집
   ============================================= */
.mix-edit-section {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 20px 20px 0;
}

.mix-mode-toggle {
  display: flex;
  gap: 8px;
}

.mix-mode-btn {
  flex: 1;
  height: 44px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #aaa;
  cursor: pointer;
}

.mix-mode-btn.active {
  border-color: #7e6ada;
  color: #7e6ada;
  font-weight: 700;
}

.mix-edit-list .schedule-item {
  align-items: center;
}

/* 번호 원 색 — 채널 색 변수 상속 (명시도 높여서 기본 규칙 override) */
.mix-edit-list .schedule-item .schedule-left .schedule-icon .num {
  background: var(--ch-color, #7e6ada);
}

/* 메인/보조 텍스트 모드 */
.mix-edit-list .schedule-item .schedule-left .schedule-icon .num.num-label {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  font-size: 10px;
}

/* 메인채널 탭 add-row 스페이서 — num-label 시각 너비에 맞춤 */
.mix-add-row.main .mix-add-spacer {
  width: 40px;
}

.mix-channel-slot {
  flex: 1;
  height: 56px;
  background: #f9f9f9;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 채널이 채워진 상태 */
.mix-channel-filled {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px;
  background: #f9f9f9;
  border-radius: 8px;
}

.mix-channel-filled .mix-filled-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
}

.mix-channel-filled .btn-delete {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* 채널 추가 버튼 래퍼 — schedule-item과 동일한 flex 구조로 정렬 */
.mix-add-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mix-add-spacer {
  width: 24px;
  flex-shrink: 0;
}

.btn-channel-add-row {
  flex: 1;
  height: 50px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  text-align: center;
  cursor: pointer;
}

.mix-channel-slot .btn-slot-add {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   공통 - 스케줄 리스트
   ============================================= */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.schedule-item .schedule-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
}

.schedule-item .schedule-left .schedule-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8e8e8;
}

.schedule-item .schedule-left .schedule-icon svg {
  width: 16px;
  height: 16px;
}

.schedule-item .schedule-left .schedule-icon .num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #7e6ada;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.schedule-item .schedule-left .schedule-line {
  width: 1px;
  flex: 1;
  min-height: 16px;
  background-color: var(--color-accent);
  opacity: 0.5;
}

.schedule-item:last-child .schedule-left .schedule-line {
  display: none;
}

/* channel_mode - 스케줄 아이템 정보 */
.schedule-item .schedule-info {
  flex: 1;
  padding: 15px;
  border-radius: 8px;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schedule-item .schedule-info .schedule-time {
  color: #7e6ada;
  font-weight: 600;
}

.schedule-item .schedule-info .schedule-name {
  font-size: 16px;
  font-weight: 600;
  color: #222;
}

.schedule-item.muted .schedule-info {
  flex: 1;
  padding: 15px;
  border-radius: 8px;
  border: 1px dashed #e0e0e0;
  background: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schedule-item.muted .schedule-info .schedule-time {
  font-size: 14px;
  font-weight: 500;
  line-height: 140%;
  color: var(--text-secondary);
}

.schedule-item.muted .schedule-info .schedule-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: var(--text-secondary);
}

/* =============================================
   channel_edit - 스케줄 편집
   ============================================= */
.schedule-edit {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule-edit .btn-add-channel {
  display: block;
  width: 100%;
  height: 52px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #222;
  text-align: center;
  cursor: pointer;
}

.schedule-edit .btn-add-channel .add-count {
  font-weight: 700;
}

/* schedule-item > schedule-edit-info */
.schedule-item .schedule-edit-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
}

.schedule-item .schedule-edit-info .schedule-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-item .schedule-edit-info .schedule-time-row .time-selects {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== custom-select 공통 컴포넌트 ===== */
.custom-select {
  position: relative;
  width: 96px;
  flex-shrink: 0;
}

.custom-select .cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 12px;
  height: 40px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #222;
  user-select: none;
}

.custom-select .cs-trigger svg {
  flex-shrink: 0;
}

.custom-select .cs-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 120px;
  max-height: 256px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  z-index: 300;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  scrollbar-width: none;
}

.custom-select .cs-dropdown::-webkit-scrollbar {
  display: none;
}

.custom-select.open .cs-dropdown {
  display: block;
}

.custom-select .cs-dropdown.up {
  top: auto;
  bottom: calc(100% + 4px);
}

.custom-select .cs-dropdown li {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #222;
  cursor: pointer;
}

.custom-select .cs-dropdown li:hover {
  background: #f4f5f7;
}

.custom-select .cs-dropdown li.selected {
  color: #7e6ada;
  background: rgba(126, 106, 218, 0.1);
}

.time-sep {
  font-size: 14px;
  color: #999;
  flex-shrink: 0;
}

.schedule-item .schedule-edit-info .schedule-time-row .btn-delete {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.schedule-item .schedule-edit-info .schedule-channel-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: var(--text-primary);
  padding: 10px 5px 5px;
}

/* =============================================
   channel_add - 채널 추가 모달
   ============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-overlay .modal-sheet {
  width: calc(100% - 32px);
  max-width: 480px;
  background: #fff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
}

.modal-overlay .modal-sheet .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e0e0e0;
}

.modal-overlay .modal-sheet .modal-header .modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #222;
}

.modal-overlay .modal-sheet .modal-header .modal-close {
  background: none;
  border: none;
  padding: 0;
  width: 32px;
  height: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-overlay .modal-sheet .modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 15px 20px 80px;
  scrollbar-width: none;
}

.modal-overlay .modal-sheet .modal-body::-webkit-scrollbar {
  display: none;
}

.modal-overlay .modal-sheet .modal-body .modal-rows-group {
  overflow: hidden;
  margin-bottom: 15px;
}

.modal-overlay .modal-sheet .modal-body .modal-row {
  display: flex;
  align-items: center;
  padding: 14px 4px;
}

.modal-overlay
.modal-sheet
.modal-body
.modal-rows-group
.modal-row:last-child {
  border-bottom: 1px solid #ececef;
}

.modal-overlay .modal-sheet .modal-body .modal-row:last-of-type {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-overlay .modal-sheet .modal-body .modal-row .modal-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-accent);
  flex-shrink: 0;
  width: 40px;
}

.modal-overlay .modal-sheet .modal-body .modal-row .modal-time-selects {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-overlay .modal-sheet .modal-body .modal-row .modal-channel-selected {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-overlay
.modal-sheet
.modal-body
.modal-row
.modal-channel-selected.active {
  color: var(--text-primary);
}

.modal-overlay .modal-sheet .modal-body .modal-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  padding: 0 0 0 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.modal-overlay .modal-sheet .modal-body .modal-search svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.modal-overlay .modal-sheet .modal-body .modal-search .search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  background: none;
}

.modal-overlay .modal-sheet .modal-body .modal-search .btn-search {
  height: 100%;
  padding: 0 18px;
  border: none;
  border-radius: 0 7px 7px 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-overlay .modal-sheet .modal-body .modal-channel-list {
  display: flex;
  flex-direction: column;
}

.modal-overlay
.modal-sheet
.modal-body
.modal-channel-list
.modal-channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
}

.modal-overlay
.modal-sheet
.modal-body
.modal-channel-list
.modal-channel-item.selected {
  background: rgba(126, 106, 218, 0.05);
  border-radius: 8px;
  padding: 14px 8px;
  margin: 0 -8px;
}

.modal-overlay
.modal-sheet
.modal-body
.modal-channel-list
.modal-channel-item
.channel-thumb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.modal-overlay
.modal-sheet
.modal-body
.modal-channel-list
.modal-channel-item
.channel-info
.channel-name {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  line-height: 20px;
  margin-bottom: 4px;
}

.modal-overlay
.modal-sheet
.modal-body
.modal-channel-list
.modal-channel-item
.channel-info
.channel-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 140%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-overlay .modal-sheet .modal-footer {
  padding: 0;
  border-top: 1px solid #f0f0f0;
}

.modal-overlay .modal-sheet .modal-footer .btn-add-confirm {
  display: block;
  width: 100%;
  height: 52px;
  background: #e0e0e0;
  border: none;
  border-radius: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

/* =============================================
   페이지 최대 너비 600px — 넓은 화면에서 가운데 정렬
   fixed 요소(하단 바 · 위로가기)는 #sb-app 밖 기준이라 따로 맞춘다
   ============================================= */
html,
body {
  background: #f2f2f4;
}

#sb-app {
  max-width: 600px;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.SBHome .bottom-menu {
  left: 0;
  right: 0;
  max-width: 600px;
  margin: 0 auto;
}

@media only screen and (min-width: 600px) {
  .btn_top {
    right: calc(50% - 300px + 14px);
  }
}

/* 로그인 화면은 틀 구분 없이 전체 흰 배경 */
body.page-login {
  background: #ffffff;
}

body.page-login #sb-app {
  box-shadow: none;
}
