/* ===========================
   키갤 중계기 - 메인 스타일
   =========================== */

/* ── CSS Variables (Dark) ── */
:root[data-theme="dark"] {
  --bg-primary: #0f0f13;
  --bg-secondary: #1a1a22;
  --bg-card: #21212d;
  --bg-card-hover: #2a2a38;
  --bg-overlay: rgba(0,0,0,0.75);
  --border-color: #2e2e3e;
  --border-subtle: #252533;
  --text-primary: #f0f0f8;
  --text-secondary: #9898b8;
  --text-muted: #5c5c7a;
  --accent: #7c6af5;
  --accent-hover: #9585ff;
  --accent-soft: rgba(124,106,245,0.15);
  --live-color: #ff4f6d;
  --live-soft: rgba(255,79,109,0.15);
  --success: #3ecf8e;
  --warning: #f5a623;
  --info: #4facfe;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.6);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.8);
  --header-bg: rgba(15,15,19,0.95);
  --scrollbar-thumb: #3a3a50;
  --fab-bg: #7c6af5;
  --badge-bg: rgba(255,79,109,0.2);
  /* 최근 게시물 영역 (배경만, 동일 톤) */
  --recent-zone-title-bg: rgba(124, 106, 245, 0.09);
  --recent-zone-body-bg: rgba(152, 152, 184, 0.07);
  --recent-zone-comment-bg: rgba(98, 98, 128, 0.1);
  --recent-zone-comment-item-bg: rgba(0, 0, 0, 0.12);
}

/* ── CSS Variables (Light) ── */
:root[data-theme="light"] {
  --bg-primary: #f4f4f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f8;
  --bg-overlay: rgba(0,0,0,0.4);
  --border-color: #e0e0ee;
  --border-subtle: #ebebf5;
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #9090b0;
  --accent: #6355e0;
  --accent-hover: #7c6af5;
  --accent-soft: rgba(99,85,224,0.1);
  --live-color: #e03050;
  --live-soft: rgba(224,48,80,0.1);
  --success: #27ae6e;
  --warning: #d4901a;
  --info: #2b8adb;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.18);
  --header-bg: rgba(244,244,249,0.95);
  --scrollbar-thumb: #c0c0d8;
  --fab-bg: #6355e0;
  --badge-bg: rgba(224,48,80,0.12);
  /* 최근 게시물 영역 (배경만, 동일 톤) */
  --recent-zone-title-bg: rgba(99, 85, 224, 0.07);
  --recent-zone-body-bg: rgba(90, 90, 122, 0.06);
  --recent-zone-comment-bg: rgba(144, 144, 176, 0.1);
  --recent-zone-comment-item-bg: rgba(255, 255, 255, 0.55);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
  padding-bottom: 80px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 1rem;
  max-width: 1400px; margin: 0 auto;
  gap: 0.5rem;
}

.header-left { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

.logo-icon {
  font-size: 1.2rem; flex-shrink: 0;
  color: var(--accent);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  border-radius: 8px;
}
.logo-title {
  font-size: 1.15rem; font-weight: 700;
  color: var(--accent);
  white-space: nowrap; flex-shrink: 0;
}

.live-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--badge-bg);
  color: var(--live-color);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.75rem; font-weight: 600;
  white-space: nowrap;
}
.live-badge .fa-circle { font-size: 0.5rem; animation: blink 1.2s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}

/* ── Tab Nav ── */
.tab-nav {
  display: flex; overflow-x: auto; gap: 0;
  max-width: 1400px; margin: 0 auto;
  padding: 0 1rem;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  padding: 0.7rem 1.2rem;
  font-size: 0.875rem; font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  display: flex; align-items: center; gap: 0.4rem;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Buttons ── */
.btn-icon {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}
.btn-icon:hover { background: var(--accent-soft); color: var(--accent); }

.btn-sm {
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem; font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
  border: none;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Main Content ── */
.main-content {
  max-width: 1400px; margin: 0 auto;
  padding: 1.2rem 1rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Section Title ── */
.section-title-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.section-title-row h2 {
  font-size: 1.05rem; font-weight: 600;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 0.5rem;
}
.section-title-row h2 i { color: var(--accent); }

.last-update { font-size: 0.78rem; color: var(--text-muted); }
.section-gap { margin-top: 2rem; }
.section-hint { font-size: 0.78rem; color: var(--text-muted); }

.stream-time, .stream-duration { display: inline-flex; align-items: center; gap: 0.25rem; }
.stream-duration { color: var(--live-color); }

/* ── Filter Row ── */
.filter-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem; font-family: inherit;
  outline: none;
  width: 180px;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

.select-filter {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem; font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.select-filter:focus { border-color: var(--accent); }

/* ── Live Grid ── */
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.live-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.live-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.live-card.is-live { border-color: var(--live-color); }

.live-card-thumb {
  width: 100%; padding-top: 56.25%;
  background: var(--bg-secondary);
  position: relative; overflow: hidden;
}
.live-card-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.thumb-wrap { position: absolute; inset: 0; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.thumb-wrap img.img-error { display: none; }
.thumb-wrap img.img-error + .thumb-placeholder { display: flex; }
.live-card-thumb .thumb-placeholder,
.relay-group-thumb .thumb-placeholder,
.relay-feed-thumb .thumb-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
}
.thumb-wrap .thumb-placeholder { display: none; }
.live-pill {
  position: absolute; top: 8px; left: 8px;
  background: var(--live-color);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 0.3rem;
  letter-spacing: 0.05em;
}
.live-pill .fa-circle { font-size: 0.45rem; animation: blink 1.2s infinite; }
.scheduled-pill {
  position: absolute; top: 8px; left: 8px;
  background: var(--warning);
  color: #1a1a1a;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 0.25rem;
  max-width: calc(100% - 16px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-card.is-scheduled { border-color: var(--warning); }
.live-card.is-ended { opacity: 0.88; border-color: var(--border-subtle); }
.live-card.is-ended .live-card-thumb img { filter: grayscale(0.35); }
.stream-scheduled { color: var(--warning); font-weight: 500; }
.ended-pill {
  position: absolute; top: 8px; left: 8px;
  background: var(--text-muted);
  color: var(--bg-primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.ended-pill-sm { top: 6px; left: 6px; font-size: 0.62rem; padding: 0.15rem 0.4rem; }
.stream-ended { color: var(--text-muted); font-weight: 500; }
.scheduled-section,
.ended-section {
  margin-top: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border-subtle);
}
.scheduled-section .section-title-row h2 {
  font-size: 1rem;
  color: var(--warning);
}
.scheduled-live-grid .live-card { border-color: var(--warning); }
.ended-section .section-title-row h2 {
  font-size: 1rem;
  color: var(--text-secondary);
}
.ended-live-grid .live-card { opacity: 0.92; }
.relay-group-card.is-ended { opacity: 0.9; border-color: var(--border-subtle); }
.relay-group-card.is-ended .relay-group-thumb img { filter: grayscale(0.3); }
.ended-relay-list { margin-top: 0.25rem; }
.relay-count-badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem; font-weight: 600;
}

.live-card-body { padding: 0.8rem; }
.live-card-platform {
  font-size: 0.72rem; font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.3rem;
  display: flex; align-items: center; gap: 0.3rem;
  flex-wrap: wrap;
}
.live-card-channel {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.7rem;
}
.live-card-channel::before { content: '·'; margin-right: 0.2rem; }
.live-card-title {
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: 0.4rem;
}
.live-card-meta {
  font-size: 0.78rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.6rem;
  flex-wrap: wrap;
}
.live-card-meta i { font-size: 0.7rem; }

/* ── Relay Preview (최근 5개 중계) ── */
.relay-preview-wrap { display: flex; flex-direction: column; gap: 0; }

.relay-feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.relay-feed-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.relay-feed-header {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.relay-feed-thumb {
  width: 72px; height: 48px;
  border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-secondary); position: relative;
}
.relay-feed-info { flex: 1; min-width: 0; }
.relay-feed-title {
  font-size: 0.9rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.relay-feed-meta {
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 0.25rem;
  display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
}
.relay-feed-arrow { color: var(--text-muted); font-size: 0.8rem; }
.relay-feed-messages {
  padding: 0.6rem 0.8rem 0.8rem;
  display: flex; flex-direction: column; gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}
.feed-empty {
  font-size: 0.8rem; color: var(--text-muted);
  padding: 0.5rem; text-align: center;
}

/* ── Relay Group List ── */
.relay-group-list { display: flex; flex-direction: column; gap: 1.5rem; }

.relay-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.relay-group-card:hover { box-shadow: var(--shadow-md); }

.relay-group-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.relay-group-thumb {
  width: 80px; height: 56px;
  border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-secondary); position: relative;
}
.relay-group-thumb .thumb-wrap { position: absolute; inset: 0; }

.relay-group-info { flex: 1; min-width: 0; }
.relay-group-platform {
  font-size: 0.75rem; font-weight: 600; color: var(--accent);
  margin-bottom: 0.2rem;
}
.relay-group-title {
  font-size: 1rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.relay-group-meta {
  font-size: 0.78rem; color: var(--text-muted);
  margin-top: 0.25rem;
  display: flex; gap: 0.8rem; flex-wrap: wrap;
}

.btn-relay-detail {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
  display: flex; align-items: center; gap: 0.35rem;
  white-space: nowrap; flex-shrink: 0;
}
.btn-relay-detail:hover { background: var(--accent); color: white; }

.relay-chat-feed {
  padding: 0.7rem 1rem 0.9rem;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.meta-link { color: var(--text-muted); }
.meta-link:hover { color: var(--accent); }

.timeline-show-more {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 0.8rem;
  padding: 0.4rem 0; margin-top: 0.2rem;
  font-family: inherit;
  display: flex; align-items: center; gap: 0.35rem;
}
.timeline-show-more:hover { text-decoration: underline; }

/* ── 채팅창 UI (공통) ── */
.chat-room {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-room-preview { max-height: 420px; }
.chat-room-group { border: none; border-radius: 0; background: transparent; }
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.5rem 0.65rem;
  overflow-y: auto;
  max-height: 360px;
}
.chat-room-preview .chat-messages { max-height: 360px; }

.chat-msg {
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}
.chat-msg:last-child { border-bottom: none; }
.chat-msg:hover { background: var(--bg-card-hover); }
.chat-msg-new { animation: chatHighlight 0.6s ease; }
@keyframes chatHighlight {
  from { background: var(--accent-soft); }
  to { background: transparent; }
}

.chat-stream-label {
  font-size: 0.72rem; color: var(--text-muted);
  margin-bottom: 0.3rem;
  display: flex; align-items: center; gap: 0.35rem;
}
.chat-stream-label span { color: var(--accent); font-weight: 600; }

.chat-msg-head {
  display: flex; align-items: center; gap: 0.45rem;
  margin-bottom: 0.2rem; flex-wrap: wrap;
}
.chat-author { font-size: 0.78rem; font-weight: 600; color: var(--accent); }
.chat-time { font-size: 0.72rem; color: var(--text-muted); }
.chat-link { color: var(--text-muted); font-size: 0.75rem; margin-left: auto; }
.chat-link:hover { color: var(--accent); }

.chat-msg-title {
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 0.2rem;
  word-break: break-word;
}
.chat-msg-body {
  font-size: 0.84rem; color: var(--text-secondary);
  line-height: 1.55; word-break: break-word;
  max-height: 4.5em; overflow: hidden; position: relative;
}
.dc-content { line-height: 1.55; word-break: break-word; }
.dc-content img.dc-img { max-width: 100%; height: auto; border-radius: 6px; margin: 0.25rem 0; }
.dc-content img.dc-img.dccon { max-height: 80px; width: auto; vertical-align: middle; }
.dccon-fallback,
.comment-text .dccon-fallback {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-tertiary, rgba(255,255,255,0.06));
  color: var(--text-muted);
  font-size: 0.8rem;
}
.dc-content video.dc-img.dccon-video {
  max-height: 120px;
  max-width: 200px;
  width: auto;
  height: auto;
  vertical-align: middle;
  border-radius: 4px;
  background: #000;
}
.dc-content video.dc-img.dc-gif,
.recent-post-body video.dc-gif {
  display: block;
  max-width: 100%;
  max-height: min(420px, 70vh);
  width: auto;
  height: auto;
  border-radius: 6px;
  margin: 0.35rem 0;
  background: #000;
}
.dc-content img.dc-img[src*="gallview_loading"],
.dc-content img.dc-img[src*="loading_ori"] { display: none !important; }

/* 디시 og-div 스타일 유튜브 링크 카드 */
.dc-content a.dc-yt-card,
.recent-post-body a.dc-yt-card {
  display: flex;
  align-items: stretch;
  width: min(100%, 420px);
  max-width: 100%;
  margin: 0.45rem 0;
  border: 1px solid var(--border-subtle, #dfe1ee);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-secondary, #fff);
  text-decoration: none;
  color: inherit;
  line-height: 1.45;
  box-sizing: border-box;
}
.dc-yt-card-thumb {
  flex: 0 0 104px;
  width: 104px;
  min-height: 78px;
  border-right: 1px solid var(--border-subtle, #dfe1ee);
  overflow: hidden;
  background: #000;
}
.dc-yt-card-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 78px;
  object-fit: cover;
  object-position: center;
}
.dc-yt-card-info {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
}
.dc-yt-card-tit {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dc-yt-card-txt {
  font-size: 0.74rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dc-yt-card-site {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.dc-content .post-link-only { color: var(--text-muted); font-style: italic; font-size: 0.82rem; }
.thread-msg-body.dc-content { font-size: 0.84rem; color: var(--text-secondary); margin-top: 0.2rem; }
.reply-text.dc-content img.dc-img.dccon,
.comment-text img.dc-img.dccon,
.chat-msg-body img.dc-img.dccon {
  max-height: 80px;
  width: auto;
  vertical-align: middle;
  display: inline-block;
}
.reply-text.dc-content video.dc-img.dccon-video,
.comment-text video.dc-img.dccon-video,
.comment-text video.written_dccon,
.chat-msg-body video.dc-img.dccon-video,
.chat-msg-body video.written_dccon {
  max-height: 100px;
  max-width: 180px;
  vertical-align: middle;
}
.chat-msg-body.expanded,
.chat-msg-body.has-media { max-height: none; }
.chat-msg-body:not(.expanded)::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1.2em;
  background: linear-gradient(transparent, var(--bg-secondary));
  pointer-events: none;
}
.chat-msg-foot { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }
.chat-expand-btn {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 0.75rem;
  font-family: inherit; padding: 0.15rem 0;
  margin-top: 0.15rem;
}

.chat-comments-wrap {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border-subtle);
}
.chat-comments-wrap .comment-item { background: var(--bg-card); }
.comment-list.expanded {
  display: block;
  padding: 0.35rem 0 0;
}
.comments-open .comment-list.expanded {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}
.comment-empty, .comment-loading {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  padding: 0.25rem 0;
}
.post-list-chat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-list-recent {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
}

#tab-recent .section-title-row {
  margin-bottom: 0.85rem;
}

.recent-relay-live-slot {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 320px;
}
.recent-relay-live-slot:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.recent-relay-live-slot .live-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.recent-relay-live-slot .live-card:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}
.recent-relay-live-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}
.recent-relay-live-author {
  font-weight: 600;
  color: var(--text-secondary);
}
.recent-relay-live-time { margin-left: auto; }
.recent-relay-live-link {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.recent-relay-live-link:hover { color: var(--accent); }
.post-list-chat .chat-msg {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.post-list-chat .chat-msg:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.recent-post-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  margin: 0 0 0.65rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.recent-post-item:last-child {
  margin-bottom: 0;
}
.recent-post-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
}
.recent-post-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
  padding: 0;
}
.collect-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0;
}
.collect-pill i {
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.85;
}
.recent-post-body-pending,
.recent-post-comments.is-pending {
  min-height: 1.5rem;
}
.recent-post-author { font-weight: 600; color: var(--text-secondary); }
.recent-post-item.is-relay {
  border-left: 2px solid rgba(124, 106, 245, 0.45);
  padding-left: 0.45rem;
}
.recent-post-item.is-relay:hover {
  background: var(--accent-soft);
}
.relay-post-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(124, 106, 245, 0.35);
  flex-shrink: 0;
}
.relay-post-badge-platform {
  display: inline-flex;
  align-items: center;
}
.relay-post-badge-platform i { font-size: 0.72rem; }
.yt-sync-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-elevated, rgba(255, 255, 255, 0.06));
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.yt-sync-bar a,
.yt-sync-bar .yt-sync-btn {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.yt-sync-bar .yt-sync-btn {
  background: transparent;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.yt-sync-bar .yt-sync-bookmarklet {
  font-size: 0.78rem;
  opacity: 0.9;
}
.recent-post-time { margin-left: auto; }
.recent-post-stats,
.recent-post-relay-info .recent-post-stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}
.recent-post-stats .post-stat,
.recent-post-relay-info .post-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}
.recent-post-stats .post-stat i,
.recent-post-relay-info .post-stat i {
  font-size: 0.62rem;
  opacity: 0.85;
}
.recent-post-link { color: var(--text-muted); }
.recent-post-link:hover { color: var(--accent); }
.recent-post-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 0.35rem;
  padding: 0;
  word-break: break-word;
  color: var(--text-primary);
  background: transparent;
  border-radius: 0;
}
.recent-post-body {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
  word-break: break-word;
  margin: 0 0 0.5rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.recent-post-body-pending {
  min-height: 1.35rem;
  margin-bottom: 0.45rem;
}
.recent-post-body img,
.recent-post-body .dc-img,
.recent-post-body video.dc-img.dccon-video {
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  margin: 0.25rem 0;
  display: block;
}
.recent-post-relay {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.4rem 0 0.5rem;
  padding: 0.5rem 0 0.5rem 0.45rem;
  border-radius: 0;
  border: none;
  border-left: 2px solid var(--accent);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.recent-post-relay:hover {
  background: var(--accent-soft);
}
.recent-post-relay-thumb {
  width: 72px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-secondary);
  position: relative;
}
.recent-post-relay-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-post-relay-thumb .thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.1rem;
}
.recent-post-relay-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.78rem;
}
.recent-post-relay-title {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-post-relay-channel {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.recent-post-relay-status {
  font-size: 0.68rem;
  font-weight: 600;
}
.recent-post-relay-status.live { color: var(--live-color); }
.recent-post-relay-status.ended { color: var(--text-muted); }
.recent-post-relay-status.upcoming { color: var(--warning); }
.recent-post-relay-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}
.recent-post-embed {
  margin: 0.4rem 0 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #000;
  width: 100%;
  max-width: 480px;
}
.recent-post-embed-yt {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  max-height: min(56vw, 315px);
}
.recent-post-embed-yt iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.recent-post-embed-yt-vertical {
  max-width: 280px;
  aspect-ratio: 9 / 16;
  max-height: min(70vh, 480px);
  margin-left: auto;
  margin-right: auto;
}
.recent-post-body img[src*="ytimg.com"],
.recent-post-body img.yt-preview {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 560px;
  height: auto;
  max-height: none;
  object-fit: contain;
}
.recent-post-comments {
  margin: 0.15rem 0 0;
  padding: 0.45rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: transparent;
  border-radius: 0;
  border-top: 1px solid var(--border-subtle);
  min-height: 1.25rem;
}
.recent-post-comments.is-pending {
  min-height: 1.35rem;
}
.recent-post-comments .comment-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.2rem 0;
  margin: 0;
}
.recent-comment {
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.3rem 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.recent-comment:last-child {
  border-bottom: none;
}
.recent-comment.is-reply {
  margin-left: 0.65rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-subtle);
  opacity: 0.95;
}
.recent-comment-author {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 0.35rem;
}
.recent-comment-text { color: var(--text-muted); }
.recent-comment-text.dc-content img.dc-img.dccon,
.recent-comment-text img.dc-img.dccon {
  max-height: 80px;
  width: auto;
  vertical-align: middle;
  display: inline-block;
}
.recent-post-body video.written_dccon,
.recent-post-body video.dccon-video,
.recent-comment-text.dc-content video.dc-img.dccon-video,
.recent-comment-text video.dc-img.dccon-video,
.recent-comment-text video.written_dccon {
  max-height: 100px;
  max-width: 180px;
  vertical-align: middle;
}
.recent-comment-time {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  opacity: 0.85;
}

/* ── X 중계 탭 ── */
.x-view-toggle {
  display: inline-flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.2s, color 0.2s;
}
.view-toggle-btn:hover { color: var(--text-secondary); }
.view-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}
.x-relay-container { min-height: 120px; }
.x-author-list { display: flex; flex-direction: column; gap: 1rem; }
.x-author-group {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.x-author-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}
.x-author-group-title { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.x-author-name { font-weight: 600; font-size: 0.92rem; }
.x-author-meta { font-size: 0.75rem; color: var(--text-muted); }
.x-profile-link {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.x-profile-link:hover { color: #e7e9ea; }
.x-chat-room .chat-messages { padding: 0.5rem 0.75rem; }
.x-timeline-room {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.x-timeline-room .chat-messages { padding: 0.5rem 0.75rem; }
.x-post-wrap {
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 0 0.65rem;
}
.x-post-wrap:last-child { border-bottom: none; }
.x-post-xlink {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e7e9ea;
  background: rgba(231, 233, 234, 0.08);
  border: 1px solid rgba(231, 233, 234, 0.2);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  margin-bottom: 0.35rem;
  text-decoration: none;
}
.x-post-xlink:hover { background: rgba(231, 233, 234, 0.15); }
.x-post-wrap .chat-msg {
  background: transparent;
  border: none;
  padding: 0;
  cursor: inherit;
}
.x-post-wrap .chat-msg:hover { background: transparent; }

.relay-preview-headers {
  display: flex; gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.65rem;
  margin-bottom: 0.5rem;
  scrollbar-width: none;
}
.relay-preview-headers::-webkit-scrollbar { display: none; }
.relay-preview-chip {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.2s;
  max-width: 220px;
}
.relay-preview-chip:hover { border-color: var(--accent); }
.relay-preview-chip.is-ended { opacity: 0.92; }
.relay-preview-chip.is-ended .chip-thumb img { filter: grayscale(0.25); }
.chip-thumb {
  width: 40px; height: 30px; border-radius: 4px;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.chip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.chip-info { text-align: left; min-width: 0; }
.chip-title {
  display: block; font-size: 0.78rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip-channel { display: block; font-size: 0.68rem; color: var(--text-muted); }
.chip-meta { display: block; font-size: 0.68rem; color: var(--text-muted); }
.relay-group-channel { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }

.hidden { display: none !important; }

/* ── Post List ── */
.post-list { display: flex; flex-direction: column; gap: 0.5rem; }

.post-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  display: flex; align-items: flex-start; gap: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.post-item:hover { background: var(--bg-card-hover); border-color: var(--accent); }
.post-item.has-relay { border-left: 3px solid var(--accent); }

.post-item-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 8px;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; color: var(--text-muted);
}
.post-item.has-relay .post-item-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.post-item-info { flex: 1; min-width: 0; }
.post-item-title {
  font-size: 0.9rem; font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-item-content {
  font-size: 0.82rem; color: var(--text-secondary);
  line-height: 1.5; margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-item-meta {
  font-size: 0.75rem; color: var(--text-muted);
  display: flex; gap: 0.6rem; flex-wrap: wrap;
}
.post-relay-tag {
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem; font-weight: 600;
}

/* ── Pagination ── */
.pagination {
  display: flex; justify-content: center;
  align-items: center; gap: 0.4rem;
  margin-top: 1.5rem; flex-wrap: wrap;
}
.page-btn {
  min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 0.85rem; font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.page-btn:hover, .page-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── 라이브 카드 (모바일 작을 때) ── */
@media (max-width: 340px) {
  .live-grid { grid-template-columns: 1fr; }
}

/* ── 빈 방송 안내 ── */
.live-offline-card {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}
.live-offline-card .offline-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.live-offline-card p { font-size: 0.9rem; }

/* ── 데모 배너 ── */
.demo-banner {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.83rem; color: var(--text-secondary);
}
.demo-banner i { color: var(--accent); flex-shrink: 0; }
.demo-banner strong { color: var(--text-primary); }

/* ── Bottom Sheet ── */
.bottom-sheet-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.bottom-sheet-overlay.active { opacity: 1; pointer-events: all; }

.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 201;
  background: var(--bg-secondary);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  height: 90vh;
  display: flex; flex-direction: column;
}
.bottom-sheet.open { transform: translateY(0); }

.bottom-sheet-handle {
  padding: 0.7rem 1rem 0;
  flex-shrink: 0;
}
.handle-bar {
  width: 48px; height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  margin: 0 auto 0.7rem;
}
.sheet-title-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 600; font-size: 0.95rem;
}
.sheet-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.1rem;
  padding: 0.25rem;
  border-radius: 6px;
  transition: color 0.2s;
}
.sheet-close-btn:hover { color: var(--text-primary); }

.bottom-sheet-content {
  flex: 1; overflow: hidden;
  padding: 0;
}
.bottom-sheet-content iframe {
  width: 100%; height: 100%;
  border: none;
}

/* ── FAB ── */
.fab-gall-btn {
  position: fixed; bottom: 20px; right: 16px;
  z-index: 150;
  background: var(--fab-bg);
  color: white;
  border: none; cursor: pointer;
  border-radius: 100px;
  padding: 0.7rem 1.2rem;
  font-size: 0.875rem; font-weight: 600;
  font-family: inherit;
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(124,106,245,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab-gall-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124,106,245,0.5);
}
.fab-gall-btn:active { transform: translateY(0); }
.fab-label { font-size: 0.82rem; }

/* ── Crawl Progress Banner ── */
.crawl-progress-banner {
  position: sticky;
  top: var(--header-height, 0);
  z-index: 85;
  background: linear-gradient(90deg, rgba(124, 106, 245, 0.15), rgba(124, 106, 245, 0.05));
  border-bottom: 1px solid var(--border-color);
  padding: 0.55rem 1rem;
}
.crawl-progress-banner[hidden] { display: none !important; }
.crawl-progress-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.crawl-progress-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}
.crawl-progress-label i { margin-right: 0.35rem; }
.crawl-progress-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 100px;
  overflow: hidden;
}
.crawl-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 100px;
  transition: width 0.35s ease;
}
.crawl-progress-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  word-break: keep-all;
}

/* ── Status Bar ── */
.status-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 0.35rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-muted);
  z-index: 90;
}
.status-dot { font-size: 0.5rem; margin-right: 0.3rem; }
.status-dot.idle { color: var(--text-muted); }
.status-dot.crawling { color: var(--warning); animation: blink 0.8s infinite; }
.status-dot.done { color: var(--success); }
.status-dot.error { color: var(--live-color); }

/* ── Toast ── */
.toast-container {
  position: fixed; bottom: 70px; left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex; flex-direction: column; gap: 0.5rem;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 100px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease;
  pointer-events: all;
  white-space: nowrap;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--live-color); color: var(--live-color); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Skeleton ── */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.skeleton-card {
  height: 200px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-msg {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted); font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}

.empty-msg {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted); font-size: 0.9rem;
}
.empty-msg .empty-icon {
  font-size: 2rem; margin-bottom: 0.8rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── Platform Colors ── */
.platform-youtube { color: #ff0000; }
.platform-twitch { color: #9146ff; }
.platform-niconico { color: #e0001b; }
.platform-default { color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .logo-title { font-size: 1rem; }
  .live-badge { font-size: 0.7rem; padding: 0.15rem 0.5rem; }
  .live-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.7rem; }
  .section-title-row { flex-direction: column; align-items: flex-start; }
  .filter-row { width: 100%; }
  .search-input { width: 100%; flex: 1; }
  .relay-group-thumb { width: 60px; height: 42px; }
  .relay-group-title { font-size: 0.9rem; }
  .relay-group-actions { flex-direction: column; }
  .btn-relay-detail { font-size: 0.78rem; padding: 0.4rem 0.7rem; }
  .fab-gall-btn { bottom: 16px; right: 12px; padding: 0.65rem 1rem; }
  .main-content { padding: 1rem 0.7rem; }
  .header-inner { padding: 0.5rem 0.8rem; }
}

@media (max-width: 480px) {
  .live-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .relay-group-header { padding: 0.8rem; }
  .relay-timeline { padding: 0.6rem 0.8rem; }
}
