/* =====================================================================
   tube.css — TUBEモード スタイルシート（単体プロトタイプ）
   ---------------------------------------------------------------------
   ・すべてのクラスは .tm- / #tm- 接頭辞。ステップ3で HolyCMS に統合しても
     既存CSSと衝突しません（リセットも .tm-app 配下に限定）。
   ・配色はデザイントークン（CSS変数）で一元管理。
     html[data-theme="dark"] でダークモードに切り替わります。
   ===================================================================== */

/* ---------- 1. デザイントークン ---------- */
:root {
  /* 基本色（ライト） */
  --tm-bg:        #ffffff;
  --tm-bg-soft:   #f2f2f2;   /* チップ・説明ボックス */
  --tm-bg-hover:  #e9e9e9;
  --tm-surface:   #ffffff;   /* ポップオーバー等 */
  --tm-text:      #0f0f0f;
  --tm-text-2:    #606060;
  --tm-line:      #e5e5e5;
  --tm-chip:      #f2f2f2;
  --tm-chip-on:   #0f0f0f;
  --tm-chip-on-t: #ffffff;
  --tm-scrim:     rgba(0,0,0,.5);
  --tm-badge-bg:  rgba(0,0,0,.78);

  /* ブランド */
  --tm-brand:     #e5004f;   /* 紅（ロゴ・ライブ・登録） */
  --tm-brand-dk:  #b30039;
  --tm-link:      #065fd4;
  --tm-rainbow:   linear-gradient(90deg,#ff9aa2,#ffd3a5,#fdffb6,#b5ead7,#a5d8ff,#d0bfff,#ffb3de);

  /* 寸法 */
  --tm-header-h:  56px;
  --tm-rail-full: 240px;
  --tm-rail-mini: 72px;
  --tm-radius:    12px;
  --tm-radius-s:  8px;
  --tm-bnav-h:    56px;

  --tm-font: "Roboto", "Noto Sans JP", "Hiragino Kaku Gothic ProN",
             "Yu Gothic", system-ui, -apple-system, sans-serif;
  --tm-shadow: 0 4px 24px rgba(0,0,0,.16);
}
html[data-theme="dark"] {
  --tm-bg:        #0f0f0f;
  --tm-bg-soft:   #272727;
  --tm-bg-hover:  #3d3d3d;
  --tm-surface:   #212121;
  --tm-text:      #f1f1f1;
  --tm-text-2:    #aaaaaa;
  --tm-line:      #303030;
  --tm-chip:      #272727;
  --tm-chip-on:   #f1f1f1;
  --tm-chip-on-t: #0f0f0f;
  --tm-scrim:     rgba(0,0,0,.6);
  --tm-badge-bg:  rgba(0,0,0,.8);
  --tm-link:      #3ea6ff;
  --tm-shadow:    0 4px 24px rgba(0,0,0,.5);
}

/* ---------- 2. ベース（.tm-app 配下に限定した軽量リセット） ---------- */
.tm-app, .tm-app * { box-sizing: border-box; margin: 0; padding: 0; }
.tm-app {
  font-family: var(--tm-font);
  background: var(--tm-bg);
  color: var(--tm-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
.tm-app a { color: inherit; text-decoration: none; }
.tm-app button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
.tm-app img { display: block; max-width: 100%; }
.tm-app ul { list-style: none; }
.tm-ic { width: 24px; height: 24px; flex: none; }
.tm-clamp1, .tm-clamp2 {
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.tm-clamp1 { -webkit-line-clamp: 1; }
.tm-clamp2 { -webkit-line-clamp: 2; }
.tm-x-scroll { display: flex; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tm-x-scroll::-webkit-scrollbar { display: none; }
.tm-x-scroll > * { flex: none; }
.tm-app :focus-visible { outline: 2px solid var(--tm-link); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  .tm-app *, .tm-app *::before, .tm-app *::after { transition: none !important; animation: none !important; }
}

/* ---------- 3. ヘッダー ---------- */
.tm-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--tm-header-h);
  display: flex; align-items: center; gap: 4px;
  padding: 0 12px 0 8px;
  background: var(--tm-bg);
}
/* 現行サイトから受け継ぐ「虹のヘアライン」 */
.tm-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--tm-rainbow); opacity: .9; pointer-events: none;
}
.tm-iconbtn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s; position: relative; flex: none;
}
.tm-iconbtn:hover { background: var(--tm-bg-soft); }
.tm-iconbtn:active { background: var(--tm-bg-hover); }
.tm-logo {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 8px; flex: none;
}
.tm-logo-badge {
  width: 30px; height: 21px; border-radius: 6px;
  background: var(--tm-brand);
  display: inline-flex; align-items: center; justify-content: center;
}
.tm-logo-badge .tm-ic { width: 14px; height: 14px; color: #fff; }
.tm-logo-txt { font-weight: 700; font-size: 18px; letter-spacing: -.4px; white-space: nowrap; }
.tm-logo-txt b { color: var(--tm-brand); font-weight: 700; }
.tm-logo-sup { font-size: 9px; color: var(--tm-text-2); vertical-align: super; margin-left: 2px; }

.tm-head-center { flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; min-width: 0; }
.tm-search {
  display: flex; width: min(560px, 100%); height: 40px;
  border: 1px solid var(--tm-line); border-radius: 20px; overflow: hidden;
  background: var(--tm-bg);
}
.tm-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--tm-text);
  padding: 0 16px; font-size: 15px; outline: none;
}
.tm-search input::placeholder { color: var(--tm-text-2); }
.tm-search-go {
  width: 62px; border-left: 1px solid var(--tm-line);
  background: var(--tm-bg-soft); display: flex; align-items: center; justify-content: center;
}
.tm-search-go:hover { background: var(--tm-bg-hover); }
.tm-mic { background: var(--tm-bg-soft); }
.tm-head-right { display: flex; align-items: center; gap: 4px; flex: none; }
.tm-create {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px 0 10px; border-radius: 20px;
  background: var(--tm-bg-soft); font-weight: 500; white-space: nowrap;
}
.tm-create:hover { background: var(--tm-bg-hover); }
.tm-dot::before {
  content: ""; position: absolute; top: 7px; right: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--tm-brand); border: 2px solid var(--tm-bg);
}
.tm-avatar-btn { padding: 0; overflow: hidden; }
.tm-avatar-btn img { width: 32px; height: 32px; border-radius: 50%; }
@media (max-width: 759px) {
  .tm-head-center { display: none; }
  .tm-create span { display: none; }
  .tm-create { width: 40px; padding: 0; justify-content: center; border-radius: 50%; }
}
@media (min-width: 760px) { .tm-search-open { display: none; } }
@media (max-width: 419px) { .tm-create { display: none; } }

/* モバイル検索オーバーレイ */
.tm-search-ov {
  position: fixed; inset: 0 0 auto 0; z-index: 80; height: var(--tm-header-h);
  display: none; align-items: center; gap: 4px; padding: 0 8px;
  background: var(--tm-bg); border-bottom: 1px solid var(--tm-line);
}
.tm-search-ov.is-open { display: flex; }
.tm-search-ov .tm-search { flex: 1; }

/* ---------- 4. カテゴリチップ ---------- */
.tm-chipsbar {
  position: fixed; z-index: 50;
  top: var(--tm-header-h); left: 0; right: 0;
  padding: 10px 16px 12px;
  background: var(--tm-bg);
  gap: 10px;
}
.tm-chip {
  height: 32px; padding: 0 12px; border-radius: 8px;
  background: var(--tm-chip); font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s, color .12s;
}
.tm-chip:hover { background: var(--tm-bg-hover); }
.tm-chip.is-active { background: var(--tm-chip-on); color: var(--tm-chip-on-t); }
.tm-chip .tm-ic { width: 16px; height: 16px; }

/* ---------- 5. サイドバー（フル／ミニ／モバイルドロワー） ---------- */
.tm-sidebar {
  position: fixed; z-index: 55;
  top: var(--tm-header-h); bottom: 0; left: 0;
  width: var(--tm-rail-full);
  background: var(--tm-bg);
  overflow-y: auto; padding: 12px;
  scrollbar-width: thin;
}
.tm-side-item {
  display: flex; align-items: center; gap: 22px;
  width: 100%; height: 40px; padding: 0 12px;
  border-radius: 10px; font-size: 14px; text-align: left;
}
.tm-side-item:hover { background: var(--tm-bg-soft); }
.tm-side-item.is-active { background: var(--tm-bg-soft); font-weight: 500; }
.tm-side-item .tm-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-side-thumb {
  width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex: none;
}
.tm-side-divider { border: 0; border-top: 1px solid var(--tm-line); margin: 12px 4px; }
.tm-side-title {
  padding: 6px 12px 8px; font-size: 15px; font-weight: 500; color: var(--tm-text);
}
.tm-side-foot { padding: 12px; font-size: 12px; color: var(--tm-text-2); line-height: 1.7; }

/* デスクトップ：チップ帯はレールの右側から開始 */
@media (min-width: 900px) {
  .tm-chipsbar { left: var(--tm-rail-mini); padding-left: 24px; padding-right: 24px; }
  html[data-rail="full"] .tm-chipsbar { left: var(--tm-rail-full); }
}

/* デスクトップ：フル／ミニ切替 */
@media (min-width: 900px) {
  html[data-rail="mini"] .tm-sidebar { width: var(--tm-rail-mini); padding: 4px; }
  html[data-rail="mini"] .tm-side-item {
    flex-direction: column; gap: 6px; height: 72px; justify-content: center; padding: 0 2px;
  }
  html[data-rail="mini"] .tm-side-item .tm-label { flex: none; font-size: 10px; white-space: nowrap; }
  html[data-rail="mini"] .tm-side-title,
  html[data-rail="mini"] .tm-side-divider,
  html[data-rail="mini"] .tm-side-foot,
  html[data-rail="mini"] .tm-side-item[data-mini="hide"] { display: none; }
}
/* モバイル：ドロワー化 */
@media (max-width: 899px) {
  .tm-sidebar {
    top: 0; width: min(300px, 84vw); z-index: 90;
    transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: var(--tm-shadow); padding-top: 8px;
  }
  .tm-sidebar.is-open { transform: translateX(0); }
  .tm-drawer-head { display: flex; align-items: center; gap: 4px; padding: 4px 4px 8px; }
}
@media (min-width: 900px) { .tm-drawer-head { display: none; } }
.tm-scrim {
  position: fixed; inset: 0; z-index: 85; background: var(--tm-scrim);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.tm-scrim.is-open { opacity: 1; pointer-events: auto; }

/* ---------- 6. レイアウト ---------- */
.tm-main {
  padding: calc(var(--tm-header-h) + 58px) 16px 40px;
  min-height: 100vh;
}
@media (min-width: 900px) {
  .tm-main { margin-left: var(--tm-rail-mini); padding-left: 24px; padding-right: 24px; }
  html[data-rail="full"] .tm-main { margin-left: var(--tm-rail-full); }
}
@media (max-width: 899px) {
  .tm-main { padding-bottom: calc(var(--tm-bnav-h) + 32px + env(safe-area-inset-bottom)); }
}
/* チップ帯を出さない画面（マイページ等）では余白を詰める */
html[data-chips="off"] .tm-chipsbar { display: none; }
html[data-chips="off"] .tm-main { padding-top: calc(var(--tm-header-h) + 20px); }

.tm-section-h {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0 14px; font-size: 18px; font-weight: 700;
}
.tm-section-h .tm-ic { color: var(--tm-brand); }
.tm-section-h .tm-more { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--tm-text-2); }
.tm-result-h { margin: 0 0 18px; font-size: 15px; color: var(--tm-text-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tm-result-h b { color: var(--tm-text); }

/* ---------- 7. フィード（メインカード） ---------- */
.tm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  column-gap: 16px; row-gap: 36px;
}
@media (max-width: 599px) { .tm-grid { grid-template-columns: 1fr; row-gap: 26px; } }
.tm-card { display: block; text-align: left; width: 100%; }
.tm-thumb {
  display: block; width: 100%;
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--tm-radius);
  overflow: hidden; background: var(--tm-bg-soft);
}
.tm-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.tm-card:hover .tm-thumb img { transform: scale(1.03); }
.tm-badge {
  position: absolute; right: 6px; bottom: 6px;
  padding: 2px 5px; border-radius: 4px;
  background: var(--tm-badge-bg); color: #fff;
  font-size: 12px; font-weight: 500; letter-spacing: .2px;
}
.tm-badge--live { background: var(--tm-brand); display: inline-flex; align-items: center; gap: 5px; }
.tm-badge--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.tm-card-body { display: flex; gap: 12px; padding: 10px 2px 0; }
.tm-card-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; margin-top: 2px; }
.tm-card-txt { flex: 1; min-width: 0; }
.tm-card-title { font-size: 15px; font-weight: 500; line-height: 1.4; margin-bottom: 4px; }
.tm-card-meta { font-size: 13px; color: var(--tm-text-2); }
.tm-card-meta .tm-live-now { color: var(--tm-brand); font-weight: 500; }
.tm-kebab { margin: -2px -6px 0 0; color: var(--tm-text-2); width: 36px; height: 36px; }
.tm-kebab:hover { color: var(--tm-text); }

/* ---------- 8. ショート ---------- */
.tm-shelf-row { gap: 12px; padding: 2px 2px 8px; scroll-snap-type: x mandatory; }
.tm-scard {
  flex: none; width: 168px; scroll-snap-align: start;
  position: relative; aspect-ratio: 9 / 16; border-radius: var(--tm-radius);
  overflow: hidden; background: var(--tm-bg-soft); text-align: left;
}
@media (max-width: 599px) { .tm-scard { width: 44vw; max-width: 176px; } }
.tm-scard img { width: 100%; height: 100%; object-fit: cover; }
.tm-scard-ol {
  position: absolute; inset: auto 0 0 0; padding: 34px 10px 10px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.72));
  color: #fff;
}
.tm-scard-ol .tm-st { font-size: 13px; font-weight: 500; line-height: 1.35; margin-bottom: 3px; }
.tm-scard-ol .tm-sv { font-size: 12px; opacity: .85; }
.tm-scard .tm-badge { top: 6px; right: 6px; bottom: auto; }
.tm-sgrid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (min-width: 700px) { .tm-sgrid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; } }
.tm-sgrid .tm-scard { width: auto; }

/* ショート再生オーバーレイ */
.tm-splayer {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(0,0,0,.92); align-items: center; justify-content: center;
}
.tm-splayer.is-open { display: flex; }
.tm-sp-stage { display: flex; align-items: center; gap: 16px; max-height: 100%; }
.tm-sp-frame {
  position: relative; height: min(88vh, 780px); aspect-ratio: 9 / 16;
  border-radius: 16px; overflow: hidden; background: #000;
  max-width: calc(100vw - 24px);
}
.tm-sp-frame img { width: 100%; height: 100%; object-fit: cover; }
.tm-sp-info {
  position: absolute; inset: auto 56px 0 0; padding: 16px 12px;
  color: #fff; background: linear-gradient(180deg, transparent, rgba(0,0,0,.65));
}
.tm-sp-chan { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 500; }
.tm-sp-chan img { width: 28px; height: 28px; border-radius: 50%; }
.tm-sp-title { font-size: 14px; line-height: 1.4; }
.tm-sp-actions {
  position: absolute; right: 8px; bottom: 12px; display: flex; flex-direction: column; gap: 14px;
  align-items: center; color: #fff;
}
.tm-sp-act { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: #fff; }
.tm-sp-act .tm-iconbtn { background: rgba(255,255,255,.14); color: #fff; }
.tm-sp-act .tm-iconbtn:hover { background: rgba(255,255,255,.26); }
.tm-sp-nav { display: flex; flex-direction: column; gap: 14px; }
.tm-sp-nav .tm-iconbtn { width: 52px; height: 52px; background: rgba(255,255,255,.12); color: #fff; }
.tm-sp-nav .tm-iconbtn:hover { background: rgba(255,255,255,.24); }
.tm-sp-close { position: fixed; top: 12px; left: 12px; color: #fff; background: rgba(255,255,255,.12); }
@media (max-width: 699px) { .tm-sp-nav { display: none; } }

/* ---------- 9. チャンネル／マイページ ---------- */
.tm-banner {
  border-radius: var(--tm-radius); overflow: hidden;
  aspect-ratio: 6.2 / 1; background: var(--tm-bg-soft); margin-bottom: 16px;
}
@media (max-width: 699px) { .tm-banner { aspect-ratio: 3.6 / 1; } }
.tm-banner img { width: 100%; height: 100%; object-fit: cover; }
.tm-ch-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 6px; }
.tm-ch-avatar { width: 128px; height: 128px; border-radius: 50%; flex: none; }
@media (max-width: 699px) { .tm-ch-avatar { width: 72px; height: 72px; } }
.tm-ch-info { flex: 1; min-width: 0; }
.tm-ch-name { font-size: 26px; font-weight: 700; line-height: 1.25; margin-bottom: 4px; }
@media (max-width: 699px) { .tm-ch-name { font-size: 20px; } }
.tm-ch-meta { font-size: 13px; color: var(--tm-text-2); margin-bottom: 6px; }
.tm-ch-meta b { color: var(--tm-text); font-weight: 500; }
.tm-ch-desc { font-size: 13px; color: var(--tm-text-2); max-width: 640px; }
.tm-ch-desc button { color: var(--tm-text); font-weight: 500; margin-left: 4px; }
.tm-ch-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; }
.tm-ch-links a { color: var(--tm-link); display: inline-flex; align-items: center; gap: 4px; }
.tm-ch-links .tm-ic { width: 14px; height: 14px; }
.tm-ch-btns { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.tm-btn {
  height: 36px; padding: 0 16px; border-radius: 18px;
  background: var(--tm-bg-soft); font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: background .12s;
}
.tm-btn:hover { background: var(--tm-bg-hover); }
.tm-btn--solid { background: var(--tm-chip-on); color: var(--tm-chip-on-t); }
.tm-btn--solid:hover { background: var(--tm-chip-on); opacity: .88; }
.tm-btn--brand { background: var(--tm-brand); color: #fff; }
.tm-btn--brand:hover { background: var(--tm-brand-dk); }
.tm-btn .tm-ic { width: 18px; height: 18px; }

/* タブ（下線スライド式） */
.tm-tabs {
  border-bottom: 1px solid var(--tm-line);
  gap: 4px; margin: 8px 0 16px;
  position: sticky; top: var(--tm-header-h); z-index: 40; background: var(--tm-bg);
}
.tm-tab {
  position: relative; height: 46px; padding: 0 14px;
  font-size: 14px; font-weight: 500; color: var(--tm-text-2); white-space: nowrap;
}
.tm-tab:hover { color: var(--tm-text); }
.tm-tab.is-active { color: var(--tm-text); }
.tm-tab.is-active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 3px; border-radius: 3px 3px 0 0; background: var(--tm-text);
}

/* 絞り込みチップ（並び順・公開設定） */
.tm-filters { gap: 8px; margin: 0 0 16px; align-items: center; }
.tm-filters .tm-sep { width: 1px; height: 20px; background: var(--tm-line); flex: none; margin: 0 4px; }

/* マイページの2列管理グリッド */
.tm-mygrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
@media (min-width: 700px)  { .tm-mygrid { grid-template-columns: repeat(3, 1fr); gap: 22px 16px; } }
@media (min-width: 1100px) { .tm-mygrid { grid-template-columns: repeat(4, 1fr); } }
.tm-mycard { text-align: left; }
.tm-mycard .tm-thumb { border-radius: var(--tm-radius-s); }
.tm-my-title { font-size: 13px; font-weight: 500; line-height: 1.4; margin: 8px 0 3px; }
.tm-my-meta { font-size: 12px; color: var(--tm-text-2); }
.tm-my-stats {
  display: flex; align-items: center; gap: 12px; margin-top: 5px;
  font-size: 12px; color: var(--tm-text-2);
}
.tm-my-stats span { display: inline-flex; align-items: center; gap: 4px; }
.tm-my-stats .tm-ic { width: 15px; height: 15px; }

/* 再生リスト（シリーズ）カード */
.tm-plgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px 16px; }
@media (max-width: 599px) { .tm-plgrid { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; } }
.tm-plthumb { display: block; width: 100%; position: relative; border-radius: var(--tm-radius); overflow: hidden; aspect-ratio: 16 / 9; }
.tm-plthumb::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: -4px; height: 4px;
  border-radius: 4px 4px 0 0; background: rgba(255,255,255,.6);
}
.tm-plthumb img { width: 100%; height: 100%; object-fit: cover; }
.tm-plcount {
  position: absolute; inset: auto 0 0 0; padding: 5px 8px;
  background: rgba(0,0,0,.7); color: #fff; font-size: 12px;
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
}
.tm-plcount .tm-ic { width: 15px; height: 15px; }

/* お知らせ（コミュニティ投稿風） */
.tm-postlist { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.tm-post {
  display: flex; gap: 12px; padding: 14px;
  border: 1px solid var(--tm-line); border-radius: var(--tm-radius); text-align: left;
}
.tm-post:hover { background: var(--tm-bg-soft); }
.tm-post img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.tm-post-cat {
  display: inline-block; font-size: 11px; font-weight: 500; color: var(--tm-brand);
  border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; margin-bottom: 5px;
}
.tm-post-t { font-size: 14px; font-weight: 500; line-height: 1.45; }
.tm-post-m { font-size: 12px; color: var(--tm-text-2); margin-top: 4px; }

/* 概要 */
.tm-about { max-width: 720px; font-size: 14px; line-height: 1.9; }
.tm-about h3 { font-size: 16px; margin: 22px 0 8px; }
.tm-about-stats { display: flex; gap: 24px; margin: 14px 0; flex-wrap: wrap; }
.tm-about-stats div { text-align: center; }
.tm-about-stats b { display: block; font-size: 22px; }
.tm-about-stats span { font-size: 12px; color: var(--tm-text-2); }

/* ---------- 10. 一覧ギャラリー（密集グリッド） ---------- */
.tm-dense { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; border-radius: var(--tm-radius); overflow: hidden; }
@media (min-width: 700px)  { .tm-dense { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .tm-dense { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1400px) { .tm-dense { grid-template-columns: repeat(6, 1fr); } }
.tm-dcell { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--tm-bg-soft); }
.tm-dcell img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s, filter .2s; }
.tm-dcell:hover img { transform: scale(1.05); filter: brightness(1.06); }
.tm-dcell .tm-badge { right: 4px; bottom: 4px; font-size: 11px; }

/* ---------- 11. ウォッチページ ---------- */
.tm-watch { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 1100px) { .tm-watch { grid-template-columns: minmax(0, 1fr) 402px; } }
.tm-player {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--tm-radius);
  overflow: hidden; background: #000; margin-bottom: 12px;
}
.tm-player img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.tm-player-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.tm-player-play .tm-pp {
  width: 68px; height: 48px; border-radius: 12px; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.tm-player-play:hover .tm-pp { background: var(--tm-brand); }
.tm-player-play .tm-ic { width: 30px; height: 30px; }
.tm-w-title { font-size: 19px; font-weight: 700; line-height: 1.45; margin-bottom: 10px; }
.tm-w-chan { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tm-w-chan img { width: 40px; height: 40px; border-radius: 50%; }
.tm-w-chan-t { flex: 1; min-width: 140px; }
.tm-w-chan-t b { display: block; font-size: 15px; }
.tm-w-chan-t span { font-size: 12px; color: var(--tm-text-2); }
.tm-w-actions { gap: 8px; }
.tm-seg { display: inline-flex; border-radius: 18px; overflow: hidden; background: var(--tm-bg-soft); flex: none; }
.tm-seg .tm-btn { border-radius: 0; background: transparent; }
.tm-seg .tm-sep { width: 1px; background: var(--tm-line); margin: 8px 0; }
.tm-w-desc {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--tm-radius);
  background: var(--tm-bg-soft); font-size: 14px; cursor: pointer;
}
.tm-w-desc b { font-weight: 500; }
.tm-w-desc .tm-body { margin-top: 6px; color: var(--tm-text); }
.tm-w-desc .tm-more { color: var(--tm-text-2); font-weight: 500; margin-top: 6px; display: inline-block; }
.tm-cta { margin-top: 14px; }

/* コメント */
.tm-comments { margin-top: 22px; }
.tm-c-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.tm-c-head b { font-size: 16px; }
.tm-c-sort { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--tm-text-2); }
.tm-c-new { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.tm-c-new img { width: 36px; height: 36px; border-radius: 50%; }
.tm-c-new input {
  flex: 1; border: 0; border-bottom: 1px solid var(--tm-line);
  background: transparent; color: var(--tm-text); padding: 6px 0; font: inherit; outline: none;
}
.tm-c-new input:focus { border-bottom-color: var(--tm-text); }
.tm-c-item { display: flex; gap: 12px; margin-bottom: 18px; }
.tm-c-item img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.tm-c-name { font-size: 12px; font-weight: 500; }
.tm-c-name span { color: var(--tm-text-2); font-weight: 400; margin-left: 6px; }
.tm-c-text { font-size: 13px; margin: 3px 0 5px; line-height: 1.6; }
.tm-c-acts { display: flex; align-items: center; gap: 14px; color: var(--tm-text-2); font-size: 12px; }
.tm-c-acts .tm-ic { width: 15px; height: 15px; }

/* 関連（次の動画） */
.tm-rel-chips { gap: 8px; margin-bottom: 12px; }
.tm-ccard { display: flex; gap: 10px; margin-bottom: 10px; text-align: left; width: 100%; }
.tm-ccard .tm-thumb { width: 168px; flex: none; border-radius: var(--tm-radius-s); }
@media (max-width: 479px) { .tm-ccard .tm-thumb { width: 148px; } }
.tm-cc-t { font-size: 13.5px; font-weight: 500; line-height: 1.4; margin-bottom: 4px; }
.tm-cc-m { font-size: 12px; color: var(--tm-text-2); }

/* ---------- 12. ボトムナビ ---------- */
.tm-bnav {
  position: fixed; z-index: 70; left: 0; right: 0; bottom: 0;
  height: calc(var(--tm-bnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--tm-bg); border-top: 1px solid var(--tm-line);
}
@media (min-width: 900px) { .tm-bnav { display: none; } }
.tm-bnav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10px; color: var(--tm-text);
}
.tm-bnav-item .tm-ic { width: 23px; height: 23px; }
.tm-bnav-item.is-active { font-weight: 700; }
.tm-bnav-item.is-active .tm-ic { stroke-width: 2.4; }
.tm-bnav-plus {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--tm-chip-on); color: var(--tm-chip-on-t);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; align-self: center;
}
.tm-bnav-plus .tm-ic { width: 22px; height: 22px; }

/* ---------- 13. ポップオーバー・トースト・空状態 ---------- */
.tm-pop {
  position: fixed; z-index: 110; min-width: 220px; max-width: 320px;
  background: var(--tm-surface); border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow); padding: 8px; display: none;
}
.tm-pop.is-open { display: block; }
.tm-pop-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 10px 12px; border-radius: 8px; font-size: 14px; text-align: left;
}
.tm-pop-item:hover { background: var(--tm-bg-soft); }
.tm-pop-item .tm-ic { width: 20px; height: 20px; color: var(--tm-text-2); }
.tm-pop-head { padding: 10px 12px; display: flex; gap: 12px; align-items: center; }
.tm-pop-head img { width: 40px; height: 40px; border-radius: 50%; }
.tm-pop-head b { display: block; font-size: 14px; }
.tm-pop-head span { font-size: 12px; color: var(--tm-text-2); }
.tm-pop-divider { border: 0; border-top: 1px solid var(--tm-line); margin: 8px 0; }
.tm-pop-note { padding: 4px 12px 8px; font-size: 11px; color: var(--tm-text-2); }
.tm-pop .tm-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tm-brand); flex: none; }

.tm-toast {
  position: fixed; z-index: 120; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--tm-bnav-h) + 20px + env(safe-area-inset-bottom));
  background: var(--tm-chip-on); color: var(--tm-chip-on-t);
  padding: 11px 18px; border-radius: 8px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: min(88vw, 460px); text-align: center;
}
@media (min-width: 900px) { .tm-toast { bottom: 28px; } }
.tm-toast.is-open { opacity: 1; transform: translateX(-50%) translateY(0); }

.tm-empty {
  padding: 60px 20px; text-align: center; color: var(--tm-text-2);
}
.tm-empty .tm-ic { display: block; width: 44px; height: 44px; margin: 0 auto 12px; opacity: .5; }
.tm-empty b { display: block; color: var(--tm-text); font-size: 16px; margin-bottom: 6px; }

/* ════════════════════════════════════════════════════════════════════
   14. デモプレーヤー（v1.1）：擬似再生バー・ライブタイマー・リーダー
   ════════════════════════════════════════════════════════════════════ */
.tm-demo {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 26px 14px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  color: #fff;
}
.tm-demo .tm-iconbtn { color: #fff; }
.tm-demo .tm-iconbtn:hover { background: rgba(255,255,255,.18); }
.tm-demo-track {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.32); overflow: hidden; cursor: default;
}
.tm-demo-fill {
  height: 100%; width: 0; background: var(--tm-brand);
  transition: width .12s linear;
}
.tm-demo-time { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-demo-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,.2); white-space: nowrap;
}
.tm-demo-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 10px; border-radius: 4px; background: var(--tm-brand);
}
.tm-demo-live i {
  width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: tmPulse 1.1s ease-in-out infinite;
}
@keyframes tmPulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---- マンガ リーダープレビュー ---- */
.tm-player.is-reader { background: #17130e; }
.tm-page {
  position: absolute; inset: 0; margin: auto;
  height: 100%; width: auto; max-width: 100%;
  object-fit: contain; user-select: none;
}
.tm-pg-hot {
  position: absolute; top: 0; bottom: 0; width: 26%;
  display: flex; align-items: center; color: #fff; opacity: 0;
  transition: opacity .15s ease;
}
.tm-pg-hot--prev { left: 0; justify-content: flex-start; padding-left: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,.45), transparent); }
.tm-pg-hot--next { right: 0; justify-content: flex-end; padding-right: 12px;
  background: linear-gradient(270deg, rgba(0,0,0,.45), transparent); }
.tm-player.is-reader:hover .tm-pg-hot,
.tm-pg-hot:focus-visible { opacity: 1; }
.tm-pg-hot:disabled { opacity: 0 !important; cursor: default; }
.tm-pg-hot .tm-ic { width: 30px; height: 30px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.tm-pg-count {
  position: absolute; top: 10px; left: 10px;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  color: #fff; background: rgba(0,0,0,.62);
  padding: 3px 10px; border-radius: 999px;
}
.tm-pg-close {
  position: absolute; top: 6px; right: 6px; color: #fff;
  background: rgba(0,0,0,.45);
}
.tm-pg-close:hover { background: rgba(0,0,0,.7); }
.tm-pg-cta {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
@media (max-width: 700px) {
  .tm-pg-hot { opacity: 1; width: 30%; }         /* タッチ端末では常時表示 */
  .tm-pg-hot--prev, .tm-pg-hot--next { background: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tm-demo-live i { animation: none; }
}

/* ════════════════════════════════════════════════════════════════════
   15. TUBE内完結ビュー（v2）：埋め込み・写真・記事・音楽バー・
       Good活性・チャンネル編集モーダル
   ════════════════════════════════════════════════════════════════════ */
/* --- 動画埋め込み --- */
.tm-embed { background: #000; }
.tm-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --- イラスト原寸 --- */
.tm-player.is-photo { background: #17130e; }
.tm-photo { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%;
  width: auto; height: auto; object-fit: contain; }

/* --- 記事本文（TUBE内で読める） --- */
.tm-article {
  background: var(--tm-surface); border: 1px solid var(--tm-line);
  border-radius: var(--tm-radius); padding: 20px 22px; margin: 0 0 16px;
  line-height: 2.05; font-size: 15px; overflow-wrap: anywhere;
}
.tm-article img { max-width: 100%; height: auto; border-radius: 8px; }
.tm-article h1, .tm-article h2, .tm-article h3 { line-height: 1.5; margin: 1.2em 0 .5em; }
.tm-article p { margin: 0 0 1em; }
.tm-article a { color: var(--tm-link); }
.tm-cta-min { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; }

/* --- Good（高評価）活性化 --- */
.tm-like.is-on, .tm-like.is-on .tm-ic { color: var(--tm-brand); }
.tm-like.is-on .tm-ic { fill: currentColor; }
.tm-sp-act .tm-like.is-on { background: rgba(229,0,79,.18); }

/* --- 音楽プレイヤー（下部固定・YouTube Music風） --- */
.tm-audio {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 66;
  display: none; grid-template-columns: minmax(0,1fr) auto minmax(80px,220px) auto;
  grid-template-areas: "seek seek seek seek" "info ctrl vol close";
  align-items: center; gap: 4px 12px;
  padding: 0 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--tm-surface); border-top: 1px solid var(--tm-line);
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
}
.tm-audio.is-on { display: grid; }
html.tm-audio-on .tm-main { padding-bottom: 96px; }
html.tm-audio-on .tm-bnav { display: none; }          /* モバイルはプレイヤーが主役 */
.tm-audio-open { grid-area: info; display: flex; align-items: center; gap: 10px;
  min-width: 0; background: none; border: 0; padding: 6px 0; text-align: left; cursor: pointer; color: inherit; }
.tm-au-cover { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; }
.tm-au-meta { min-width: 0; display: flex; flex-direction: column; }
.tm-au-title { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-au-sub { font-size: 11.5px; color: var(--tm-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-au-ctrl { grid-area: ctrl; display: flex; align-items: center; gap: 8px; }
.tm-au-time { font-size: 12px; color: var(--tm-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-au-seek { grid-area: seek; width: 100%; height: 14px; margin: 0; accent-color: var(--tm-brand); cursor: pointer; }
.tm-au-volwrap { grid-area: vol; display: flex; align-items: center; gap: 6px; color: var(--tm-text-2); }
.tm-au-volwrap .tm-ic { width: 17px; height: 17px; flex: none; }
.tm-au-vol { width: 100%; accent-color: var(--tm-brand); }
.tm-au-close { grid-area: close; }
@media (max-width: 700px) { .tm-au-volwrap { display: none; }
  .tm-audio { grid-template-columns: minmax(0,1fr) auto auto; grid-template-areas: "seek seek seek" "info ctrl close"; } }

/* --- チャンネル編集モーダル --- */
.tm-modal { position: fixed; inset: 0; z-index: 90; display: none;
  background: var(--tm-scrim); align-items: center; justify-content: center; padding: 18px; }
.tm-modal.is-open { display: flex; }
.tm-modal-card { width: min(560px, 100%); max-height: 92vh; overflow: auto;
  background: var(--tm-surface); color: var(--tm-text);
  border-radius: 16px; box-shadow: 0 18px 60px rgba(0,0,0,.35); }
.tm-modal-h { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--tm-line); font-size: 15px; }
.tm-modal-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.tm-f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--tm-text-2); font-weight: 700; }
.tm-f input[type="text"], .tm-f input:not([type]), .tm-f textarea {
  font: inherit; font-weight: 400; color: var(--tm-text);
  background: var(--tm-bg-soft); border: 1px solid var(--tm-line);
  border-radius: 10px; padding: 10px 12px; }
.tm-f textarea { resize: vertical; line-height: 1.8; }
.tm-f input[type="file"] { font-size: 12px; }
.tm-f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .tm-f-row { grid-template-columns: 1fr; } }
.tm-pf-prev { width: 100%; height: 74px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--tm-line); background: var(--tm-bg-soft); }
.tm-pf-prev--av { width: 74px; height: 74px; border-radius: 50%; }
.tm-modal-note { font-size: 11.5px; color: var(--tm-text-2); margin: 0; }
.tm-modal-btns { display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--tm-line); }

/* ファン登録済み・保存済み（YouTube風のグレー活性） */
.tm-fan.is-on, .tm-savebtn.is-on { background: var(--tm-bg-soft); color: var(--tm-text-2); }
.tm-savebtn.is-on .tm-ic { fill: currentColor; }
