/*
  Tiful v4 — Circle Detail Common Stylesheet (Phase D-1 + D-2)
  ===========================================================
  cd-topbar / cd-sheet / cd-action / cd-toast / cd-mock / cd-buy を統合。
  対象 HTML (7 本):
    circle_tifuler_thread_v1.html         (A-1)
    circle_tifuler_thread_create_v1.html  (A-2)
    circle_tifuler_create_v1.html         (A-3)
    circle_official_thread_v1.html        (B-1 + B-2)
    circle_peer_thread_v1.html            (C-1)
    circle_peer_thread_create_v1.html     (C-2)
    circle_peer_create_v1.html            (C-3)

  Phase D-3 (次セッション) 予定:
    各専用 prefix リネーム (cdt-tdetail-* → cd-tdetail-* 等)
    B-1 専用 .cdt-topbar__title--theme/--lab も Phase D-3 で cd- 統一

  CSS variables (各 HTML が body or :root で override 可):
    --cd-toast-bottom : toast 表示位置 (default 100px / 90px / 40px)
*/


/* ============================================ */
/* SECTION 1: cd-topbar (7/7 共通)              */
/* ============================================ */

.cd-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 52px;
  padding: 0 8px;
  background: var(--bg, #FAFAF8);
  border-bottom: 1px solid var(--line, #E8E4DD);
}

/* form 系 (A-2/A-3/C-2/C-3) で付与 = 4列 grid (右端に publish ボタン用列) */
.cd-topbar--form {
  grid-template-columns: 44px 1fr auto 44px;
}

.cd-topbar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--ink, #1F232E);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cd-topbar__btn svg {
  width: 20px;
  height: 20px;
}

.cd-topbar__title {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink, #1F232E);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.01em;
}

/* C-1 (PEER 詳細) で title 周りに icon 添える時の wrapper */
.cd-topbar__title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
}

/* form 系 (A-2/A-3/C-2/C-3) の右上「公開 / 次へ / 作る」ボタン */
.cd-topbar__publish {
  height: 32px;
  padding: 0 14px;
  margin-right: 4px;
  border: none;
  border-radius: 6px;
  background: var(--ink, #1F232E);
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 160ms ease;
}

.cd-topbar__publish:disabled {
  background: #D4D0C8;
  color: #fff;
  cursor: not-allowed;
  opacity: 1;
}


/* ============================================================ */
/* SECTION 2: cd-sheet / cd-action / cd-toast / cd-mock (7/7 共通) */
/* ============================================================ */

/* --- cd-sheet (3 点メニュー bottom sheet) --- */

.cd-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 100;
  pointer-events: none;
  transition: background 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cd-sheet-overlay.is-open {
  background: rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}

.cd-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg, #FAFAF8);
  border-radius: 14px 14px 0 0;
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 101;
  max-height: 92vh;
  overflow: auto;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
}

.cd-sheet.is-open {
  transform: translateY(0);
}

.cd-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #D4D0C8;
  margin: 10px auto 6px;
}

.cd-sheet__head {
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--line, #E8E4DD);
}

.cd-sheet__title {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink, #1F232E);
  letter-spacing: -0.005em;
}

/* C-3 で導入された二段階確認用 desc */
.cd-sheet__desc {
  padding: 0 20px 12px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted, #8A8378);
  letter-spacing: 0.02em;
  margin: 0;
}

.cd-sheet__desc strong {
  color: var(--ink, #1F232E);
  font-weight: 500;
}

.cd-sheet__body {
  padding: 14px 0 20px;
}

/* --- cd-action-list (sheet 内のアクション項目) --- */

.cd-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cd-action-list__item {
  display: block;
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line, #E8E4DD);
  text-align: left;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: var(--ink, #1F232E);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.02em;
  transition: background 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cd-action-list__item:hover {
  background: #F2F2F2;
}

.cd-action-list__item--cancel {
  color: var(--muted, #8A8378);
  text-align: center;
  border-bottom: none;
  border-top: 6px solid #F0EDE6;
}

.cd-action-list__item--danger {
  color: var(--ink, #1F232E);
  font-weight: 500;
}

.cd-action-list__item--primary {
  color: var(--ink, #1F232E);
  font-weight: 500;
}

/* --- cd-mock-section (3 点メニュー内 dev 用 mock 切替) --- */

.cd-mock-section {
  padding: 14px 20px 10px;
  border-top: 6px solid #F0EDE6;
  border-bottom: 1px solid var(--line, #E8E4DD);
  background: #F8F6F0;
}

.cd-mock-section__label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 9px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.cd-mock-section__row {
  margin-bottom: 10px;
}

.cd-mock-section__row:last-child {
  margin-bottom: 0;
}

.cd-mock-section__sub {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 10px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.cd-mock-section__btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cd-mock-section__btns--2 {
  grid-template-columns: 1fr 1fr;
}

.cd-mock-section__btns--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.cd-mock-section__btns--4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.cd-mock-section__btns button {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line, #E8E4DD);
  border-radius: 6px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--ink, #1F232E);
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, border-color 160ms ease;
}

.cd-mock-section__btns button.is-active {
  background: var(--ink, #1F232E);
  color: #fff;
  border-color: var(--ink, #1F232E);
}

.cd-mock-section__btns button strong {
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  margin-right: 4px;
  letter-spacing: 0.06em;
}

/* --- cd-toast (autosave / 通知 toast) --- */
/* default 100px / Stepper 持つ form は 90px / C-2 (PEER スレッド作成) は 40px */
/* 各 HTML が <body style="--cd-toast-bottom: 90px"> 等で override する */

.cd-toast {
  position: fixed;
  bottom: calc(var(--cd-toast-bottom, 100px) + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 12px 18px;
  background: var(--ink, #1F232E);
  color: #fff;
  border-radius: 8px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms cubic-bezier(0.22, 0.61, 0.36, 1), transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 200;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.cd-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ============================================================ */
/* SECTION 3: cd-buy (A-1 + B-1 + B-2 共通 + 各専用統合)         */
/* ============================================================ */

/* --- cd-buy-sheet (購入 bottom sheet) --- */

.cd-buy-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg, #FAFAF8);
  border-radius: 14px 14px 0 0;
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 101;
  max-height: 92vh;
  overflow: auto;
  padding: 0 24px max(24px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
}

.cd-buy-sheet.is-open {
  transform: translateY(0);
}

.cd-buy-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #D4D0C8;
  margin: 10px auto 18px;
}

.cd-buy-sheet__label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 10px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* A-1 専用: スレッド購入時のタイトル */
.cd-buy-sheet__thread-title {
  font-family: 'Noto Serif JP', serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink, #1F232E);
  line-height: 1.5;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

/* A-1 専用: スレッド作者名 */
.cd-buy-sheet__author {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.02em;
  margin-bottom: 24px;
}

/* B-1 専用: LIVE イベントタイトル */
.cd-buy-sheet__event-title {
  font-family: 'Noto Serif JP', serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink, #1F232E);
  line-height: 1.5;
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

/* B-1 専用: LIVE 提供 Circle 名 */
.cd-buy-sheet__circle-source {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.cd-buy-sheet__note {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted, #8A8378);
  margin: 0 0 28px;
  letter-spacing: 0.02em;
}

/* --- cd-buy-amount (金額表示) --- */

.cd-buy-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.cd-buy-amount__price {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 38px;
  color: var(--ink, #1F232E);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}

.cd-buy-amount__unit {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 13px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.04em;
}

/* --- cd-buy-amount__unit--monthly (Membership /月 表示 / Phase A-4 拡張) --- */

.cd-buy-amount__unit--monthly {
  font-size: 15px;
  color: var(--ink, #1F232E);
  letter-spacing: 0.02em;
}

/* --- cd-buy-benefits (Membership benefits list / Phase A-4 拡張) --- */

.cd-buy-benefits {
  list-style: none;
  margin: 8px 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cd-buy-benefits__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink, #1F232E);
  letter-spacing: 0.01em;
}

.cd-buy-benefits__icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--ink, #1F232E);
}

/* --- cd-buy-method (支払方法選択) --- */

.cd-buy-method {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.cd-buy-method__option {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line, #E8E4DD);
  border-radius: 8px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: var(--ink, #1F232E);
  cursor: pointer;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease;
}

.cd-buy-method__option.is-selected {
  border-color: var(--ink, #1F232E);
  border-width: 2px;
  padding: 13px 15px;
}

.cd-buy-method__icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink, #1F232E);
}

/* --- cd-buy-confirm / cd-buy-cancel / cd-buy-terms --- */

.cd-buy-confirm {
  display: block;
  width: 100%;
  height: 52px;
  background: var(--ink, #1F232E);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cd-buy-cancel {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 6px;
  background: transparent;
  border: none;
  color: var(--muted, #8A8378);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
}

.cd-buy-terms {
  margin-top: 16px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  color: var(--muted, #8A8378);
  text-align: center;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

.cd-buy-terms a {
  color: var(--muted, #8A8378);
  text-decoration: underline;
}

/* --- cd-buy-content--available / --soldout (B-1 専用 / body[data-seat-state] 連動) --- */

body[data-seat-state="soldout"] .cd-buy-content--available {
  display: none;
}

body[data-seat-state="available"] .cd-buy-content--soldout {
  display: none;
}

/* --- cd-buy-live-info (B-1 専用 / LIVE Ticket 詳細カード) --- */

.cd-buy-live-info {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line, #E8E4DD);
  border-radius: 10px;
  margin-bottom: 24px;
}

.cd-buy-live-info__host {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line, #E8E4DD);
}

.cd-buy-live-info__host-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #E8DBC9;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #8A8378);
}

.cd-buy-live-info__host-avatar svg {
  width: 22px;
  height: 22px;
}

.cd-buy-live-info__host-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cd-buy-live-info__host-name {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink, #1F232E);
  letter-spacing: 0.01em;
}

.cd-buy-live-info__host-role {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.02em;
}

.cd-buy-live-info__schedule {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.cd-buy-live-info__schedule-icon {
  width: 16px;
  height: 16px;
  color: var(--muted, #8A8378);
  flex-shrink: 0;
}

.cd-buy-live-info__schedule-text {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: var(--ink, #1F232E);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.cd-buy-live-info__seat-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--line, #E8E4DD);
  overflow: hidden;
  margin-bottom: 6px;
}

.cd-buy-live-info__seat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ink, #1F232E), #1F2A44);
  transition: width 240ms ease;
}

.cd-buy-live-info__seat-label {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 11px;
  color: var(--muted, #8A8378);
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* 残席ゼロ時の sheet 内 seat-fill 上書き (B-1 専用 / 灰色満タン化) */
body[data-seat-state="soldout"] .cd-buy-live-info__seat-fill {
  width: 100% !important;
  background: #B8B0A4;
}

/* --- cd-buy-soldout-info (B-1 専用 / 残席ゼロ時 info カード) --- */

.cd-buy-soldout-info {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line, #E8E4DD);
  border-radius: 10px;
  margin-bottom: 24px;
}

.cd-buy-soldout-info__title {
  font-family: 'Noto Serif JP', serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink, #1F232E);
  margin: 0 0 8px;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.cd-buy-soldout-info__note {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted, #8A8378);
  margin: 0;
  letter-spacing: 0.02em;
}


/* ============================================================ */
/* SECTION 4: B-1 専用 modifier + PEER 視点切替 modifier (Phase D-3) */
/* ============================================================ */

/* --- B-1 (公式詳細) Theme/Lab タイトル切替 ---
   body[data-circle-type="theme/lab"] に応じて該当タイトルを表示切替。
   B-1 専用だが cd-topbar 命名空間統合のため common.css に集約。 */

body[data-circle-type="lab"] .cd-topbar__title--theme,
body[data-circle-type="theme"] .cd-topbar__title--lab {
  display: none;
}

/* --- C-1/C-2/C-3 (PEER 系) Mock 視点切替ボタン strong override ---
   PEER 視点切替 (Owner / Tifuler / Member) ボタン内 strong は header 風表示。
   common.css の .cd-mock-section__btns button strong (font-size: 11px / inline) を上書き。
   親 div に cd-mock-section__btns--peer-view modifier 付与で発動。 */

.cd-mock-section__btns--peer-view button strong {
  display: block;
  font-size: 9px;
  margin-bottom: 2px;
  margin-right: 0;
  opacity: 0.7;
}


/* ============================================================ */
/* SECTION 5: B-3 LIVE 視聴 sheet + Q&A チャット UI (Phase 1+ プレビュー / cd-live-viewer-* namespace / Phase B-3) */
/* ============================================================ */

/* --- cd-live-viewer-overlay / cd-live-viewer-sheet (full-sheet base) --- */

.cd-live-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  z-index: 100;
}

.cd-live-viewer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cd-live-viewer-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg, #FAFAF8);
  border-radius: 14px 14px 0 0;
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 101;
  max-height: 96vh;
  overflow: auto;
  padding: 0 24px max(24px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
}

.cd-live-viewer-sheet.is-open {
  transform: translateY(0);
}

.cd-live-viewer-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #D4D0C8;
  margin: 10px auto 18px;
}

.cd-live-viewer-sheet__label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 10px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.cd-live-viewer-sheet__title {
  font-family: 'Noto Serif JP', serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink, #1F232E);
  line-height: 1.5;
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

.cd-live-viewer-sheet__source {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

/* --- cd-live-player (16:9 black / Vimeo 風 minimal) --- */

.cd-live-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0A0A0A;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.cd-live-player__live-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #FF5A5F;
  border-radius: 999px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  z-index: 2;
}

.cd-live-player__live-pill::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: cd-live-pulse 1.4s ease-in-out infinite;
}

@keyframes cd-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.cd-live-player__viewers {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  z-index: 2;
}

.cd-live-player__viewers-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.cd-live-player__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cd-live-player__placeholder--countdown {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 32px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.cd-live-player__placeholder--countdown-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.1em;
  font-weight: 400;
}

.cd-live-player__placeholder--play-icon svg {
  width: 56px;
  height: 56px;
  color: rgba(255, 255, 255, 0.55);
}

.cd-live-player__placeholder--ended {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: #fff;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cd-live-player__placeholder--ended-icon {
  width: 16px;
  height: 16px;
  color: #fff;
  flex-shrink: 0;
}

/* state-based hide/show (player elements) */
body[data-live-state="before"] .cd-live-player__placeholder--play-icon,
body[data-live-state="before"] .cd-live-player__placeholder--ended,
body[data-live-state="before"] .cd-live-player__live-pill,
body[data-live-state="before"] .cd-live-player__viewers {
  display: none !important;
}

body[data-live-state="during"] .cd-live-player__placeholder--countdown,
body[data-live-state="during"] .cd-live-player__placeholder--countdown-label,
body[data-live-state="during"] .cd-live-player__placeholder--ended {
  display: none !important;
}

body[data-live-state="after"] .cd-live-player__placeholder--countdown,
body[data-live-state="after"] .cd-live-player__placeholder--countdown-label,
body[data-live-state="after"] .cd-live-player__placeholder--play-icon,
body[data-live-state="after"] .cd-live-player__live-pill,
body[data-live-state="after"] .cd-live-player__viewers {
  display: none !important;
}

/* --- cd-live-host (講師パネル) --- */

.cd-live-host {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 18px;
}

.cd-live-host__avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--line, #E8E4DD);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9B9B9B;
  overflow: hidden;
}

.cd-live-host__avatar svg {
  width: 24px;
  height: 24px;
}

.cd-live-host__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cd-live-host__name {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink, #1F232E);
  letter-spacing: 0.01em;
}

.cd-live-host__role {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.02em;
}

/* --- cd-live-qa (Q&A エリア / 動画下部) --- */

.cd-live-qa {
  border-top: 1px solid var(--line, #E8E4DD);
  margin-top: 4px;
  padding-top: 16px;
}

.cd-live-qa__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cd-live-qa__title {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink, #1F232E);
  letter-spacing: 0.04em;
}

.cd-live-qa__count {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 13px;
  color: var(--muted, #8A8378);
  font-variant-numeric: tabular-nums;
}

.cd-live-qa__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.cd-live-qa__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line, #E8E4DD);
  border-radius: 10px;
  margin-bottom: 8px;
}

.cd-live-qa__textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink, #1F232E);
  background: transparent;
  min-height: 60px;
  letter-spacing: 0.02em;
}

.cd-live-qa__textarea::placeholder {
  color: var(--muted, #8A8378);
  opacity: 0.7;
}

.cd-live-qa__textarea:disabled {
  cursor: not-allowed;
}

.cd-live-qa__form-actions {
  display: flex;
  justify-content: flex-end;
}

.cd-live-qa__submit {
  padding: 8px 16px;
  background: var(--ink, #1F232E);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 160ms ease;
}

.cd-live-qa__submit:hover {
  opacity: 0.85;
}

.cd-live-qa__submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cd-live-qa__disabled-notice {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--muted, #8A8378);
  text-align: center;
  padding: 24px 16px;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.cd-live-qa__readonly-notice {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--muted, #8A8378);
  text-align: center;
  padding: 16px;
  letter-spacing: 0.02em;
  line-height: 1.6;
  border-top: 1px dotted var(--line, #E8E4DD);
  margin-top: 8px;
}

/* state-based form/notice show/hide */
body[data-live-state="before"] .cd-live-qa__form,
body[data-live-state="before"] .cd-live-qa__readonly-notice {
  display: none !important;
}

body[data-live-state="during"] .cd-live-qa__disabled-notice,
body[data-live-state="during"] .cd-live-qa__readonly-notice {
  display: none !important;
}

body[data-live-state="after"] .cd-live-qa__form,
body[data-live-state="after"] .cd-live-qa__disabled-notice {
  display: none !important;
}

/* Title suffix swap (during = "Q&A" / after = "Q&A 履歴") */
body:not([data-live-state="after"]) .cd-live-qa__title-suffix-history {
  display: none;
}

body[data-live-state="after"] .cd-live-qa__title-suffix-current {
  display: none;
}

/* --- cd-live-next (次回 LIVE 告知 section / after 状態のみ表示) --- */

.cd-live-next {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line, #E8E4DD);
}

.cd-live-next__label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 10px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.cd-live-next__card {
  display: block;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line, #E8E4DD);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.cd-live-next__card:active {
  transform: scale(0.99);
}

.cd-live-next__card-title {
  font-family: 'Noto Serif JP', serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink, #1F232E);
  margin: 0 0 6px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.cd-live-next__card-meta {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--muted, #8A8378);
  letter-spacing: 0.02em;
}

/* state-based: only show next-section in "after" */
body[data-live-state="before"] .cd-live-next,
body[data-live-state="during"] .cd-live-next {
  display: none !important;
}
