@charset "utf-8";

.stats-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 10px;
}

.rankings-grid {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.ranking-section {
  width: calc((100% - 40px) / 3);
  margin-bottom: 0;
  box-sizing: border-box;
}

.stats-header-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 5px solid var(--color-primary);
}

.stats-title-main {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  line-height: 1.1;
}

.stats-subtitle {
  font-size: 0.85rem;
  color: #aaa;
  line-height: 1.2;
}

.stat-separator {
  margin: 0 6px;
  color: #555;
}

.month-header {
  text-align: center;
  margin-bottom: 20px;
  margin-top: 10px;
}

.stats-disclaimer-card {
  max-width: 960px;
  margin: 0 auto 32px auto;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(30, 35, 45, 0.6) 0%, rgba(20, 24, 33, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.stats-disclaimer-card:hover {
  border-color: rgba(138, 180, 248, 0.25);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.disclaimer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(138, 180, 248, 0.1);
  border: 1px solid rgba(138, 180, 248, 0.22);
  border-radius: 20px;
  color: #8ab4f8;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.disclaimer-badge svg {
  flex-shrink: 0;
}

.disclaimer-text {
  margin: 0;
  font-size: 0.83rem;
  color: #9aa0a6;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.modern-month-selector {
  position: relative;
  display: inline-block;
}

.month-title-btn {
  background: none;
  border: none;
  font-size: 2.2rem;
  font-weight: bold;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding-bottom: 5px;
  border-bottom: 3px solid #ff4081;
  transition: all 0.2s ease;
  outline: none;
}

.month-title-btn:hover {
  color: #ffb74d;
  border-bottom-color: #ffb74d;
}

.month-title-btn .chevron {
  font-size: 1.2rem;
  color: inherit;
  transition: transform 0.3s ease;
}

.month-title-btn.open .chevron {
  transform: rotate(180deg);
}

.month-selector-list {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background-color: #222;
  border: 1px solid #444;
  border-radius: 12px;
  padding: 8px 0;
  margin: 0;
  list-style: none;
  width: 220px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 100;
  max-height: 350px;
  overflow-y: auto;
}

.month-selector-list::-webkit-scrollbar {
  width: 6px;
}

.month-selector-list::-webkit-scrollbar-track {
  background: transparent;
}

.month-selector-list::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.month-option {
  padding: 12px 20px;
  color: #ddd;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  text-align: center;
}

.month-option:hover {
  background-color: #383838;
  color: #fff;
}

.month-option.selected {
  color: #ff4081;
  font-weight: bold;
  background-color: rgba(255, 64, 129, 0.1);
}

.month-title {
  font-size: 2.2rem;
  font-weight: bold;
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 3px solid #ff4081;
  color: #fff;
}

.update-info {
  margin-top: 15px;
  color: #aaa;
  font-size: 0.85rem;
}

.rank-card {
  display: flex;
  flex-direction: column;
  background-color: #252525;
  margin-bottom: 12px;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #444;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, border-color 0.2s;
}

.rank-card:hover {
  transform: translateY(-2px);
  border-color: #666;
  background-color: #2a2a2a;
}

.rank-card-header {
  display: flex;
  align-items: center;
  width: 100%;
}

.rank-num {
  font-size: 1.5rem;
  font-weight: bold;
  width: 50px;
  text-align: center;
  color: #888;
  flex-shrink: 0;
}

.rank-num.top1 {
  color: #ffd700;
  font-size: 2rem;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.rank-num.top2 {
  color: #c0c0c0;
  font-size: 1.8rem;
}

.rank-num.top3 {
  color: #cd7f32;
  font-size: 1.8rem;
}

.ch-info {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  margin-right: 15px;
  text-decoration: none;
  color: inherit;
}

.ch-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: cover;
  border: 2px solid #333;
  flex-shrink: 0;
}

.ch-name {
  font-weight: bold;
  font-size: 1rem;
  color: #eee;
  line-height: 1.4;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.stat-value-box {
  text-align: right;
  min-width: 90px;
  flex-shrink: 0;
}

.stat-value-main {
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.stat-unit {
  font-size: 0.8rem;
  color: #bbb;
  margin-left: 4px;
}

.stat-data-area {
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-bar-bg {
  background: #444;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  width: 100%;
  margin-bottom: 6px;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease-out;
}

.theme-time .stat-bar-fill {
  background: linear-gradient(90deg, #ff4081, #ff80ab);
}

.theme-count .stat-bar-fill {
  background: linear-gradient(90deg, #2196f3, #64b5f6);
}

.theme-avg-time .stat-bar-fill {
  background: linear-gradient(90deg, #9c27b0, #ce93d8);
}

.theme-growth .stat-bar-fill {
  background: linear-gradient(90deg, #4caf50, #81c784);
}

.theme-active .stat-bar-fill {
  background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.theme-ccv-growth .stat-bar-fill {
  background: linear-gradient(90deg, #00bcd4, #80deea);
}

.stat-sub-info {
  font-size: 0.85rem;
  color: #aaa;
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.highlight-val {
  color: #fff;
  font-weight: bold;
  margin-left: 4px;
}

.stat-empty-msg {
  color: #aaa;
  padding: 10px;
}

.stats-tab-container {
  display: flex;
  justify-content: center;
  background-color: #1a1a1a;
  padding: 6px;
  border-radius: 12px;
  margin: 10px auto 40px auto;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #333;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.stats-tab-btn {
  background-color: transparent;
  color: #888;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.stats-tab-btn:hover {
  color: #fff;
}

.stats-tab-btn.active {
  background-color: #383838;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* =========================================
   統計ページ (Channel Stats Page) サマリー等スタイル
========================================= */
.stats-page-container {
  width: 100%;
  margin: 0 auto;
  padding: 20px 0;
  color: #eee;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.stats-summary-item {
  background: #252525;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #444;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;
}

.stats-summary-label {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 8px;
}

.stats-val-container {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.stats-summary-val {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1;
}

.stats-summary-val.val-small {
  font-size: 1.3rem;
}

.stats-unit {
  font-size: 0.85rem;
  color: #888;
  font-weight: normal;
}

.stats-summary-diff {
  font-size: 0.85rem;
  margin-top: 6px;
}

.stats-diff-plus {
  color: #ff4081;
}

.stats-diff-minus {
  color: #2196f3;
}

.stats-section-title {
  font-size: 1.1rem;
  color: #e0e0e0;
  margin: 30px 0 15px 0;
  padding-left: 10px;
  border-left: 4px solid #666;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.stats-section-title:first-of-type {
  margin-top: 10px;
}

.stats-title-note {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: normal;
  color: #aaa;
  margin-top: 0;
  margin-left: 12px;
  line-height: 1.3;
}

/* アコーディオン制御バー */
.accordion-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 25px 0 15px 0;
}

.accordion-controls-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.accordion-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-toggle-accordion {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle-accordion:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #60a5fa;
  color: #93c5fd;
}

/* アコーディオン本体 */
details.accordion-group {
  background: var(--card-bg, rgba(30, 41, 59, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

details.accordion-group summary {
  padding: 16px 20px;
  font-size: 1.1em;
  font-weight: bold;
  color: #f1f5f9;
  cursor: pointer;
  user-select: none;
  background: rgba(15, 23, 42, 0.6);
  border-left: 4px solid #3b82f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}

details.accordion-group summary::-webkit-details-marker {
  display: none;
}

details.accordion-group summary::after {
  content: '▼';
  font-size: 0.8em;
  color: #94a3b8;
  transition: transform 0.2s;
}

details.accordion-group[open] summary::after {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 20px;
}

/* チャート共通 & タッチ操作抑制 */
.chart-container-responsive {
  width: 100%;
  height: 380px;
}

.stats-chart-area,
.chart-container-responsive,
#chartCategoryPie,
canvas {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: manipulation;
}

.stats-chart-card {
  background: #252525;
  border-radius: 12px;
  padding: 15px;
  border: 1px solid #444;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.stats-chart-title {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
  border-left: 4px solid #ff4081;
  padding-left: 10px;
  color: #fff;
}

.stats-chart-area {
  width: 100%;
  height: 320px;
}

/* グリッドレイアウト */
.stats-charts-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}

.stats-charts-grid-3col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.stats-section-block {
  margin-bottom: 20px;
}

/* 期間切替ボタン */
.stats-timeframe-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 5px;
  margin-top: 15px;
}

.stats-timeframe-btn {
  background: #333;
  color: #fff;
  border: 1px solid #555;
  padding: 4px 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, border-color 0.2s;
  font-size: 0.9rem;
}

.stats-timeframe-btn:hover {
  background: #444;
  border-color: #888;
}

.stats-timeframe-btn.active {
  background: #ff4081;
  border-color: #ff4081;
  color: #fff;
  font-weight: bold;
}

/* 曜日×時間帯ヒートマップ */
.heatmap-table-wrapper {
  overflow-x: auto;
  margin-top: 12px;
}

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8em;
  text-align: center;
}

.heatmap-table th,
.heatmap-table td {
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.heatmap-table th {
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
}

.heatmap-table tr > th:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #0f172a;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.4);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

/* 企画ジャンル詳細カード */
.genre-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.genre-detail-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.genre-title {
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.genre-count {
  font-size: 0.78em;
  color: #94a3b8;
  margin-top: 4px;
}

.genre-count b {
  color: #cbd5e1;
}

.genre-meta-row {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78em;
}

.meta-viewers {
  color: #94a3b8;
  white-space: nowrap;
}

.meta-viewers b {
  color: #38bdf8;
  font-weight: 700;
}

.meta-viewers.meta-unmeasured {
  color: #64748b;
}

.meta-viewers.meta-unmeasured .unmeasured-label {
  color: #64748b;
  font-weight: 600;
}

.meta-likes {
  color: #94a3b8;
  white-space: nowrap;
}

.meta-likes b {
  color: #fbbf24;
  font-weight: 700;
}

/* タイトルキーワード分析カード */
.keyword-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.keyword-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.keyword-name {
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.92em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keyword-hash {
  color: #c084fc;
  font-weight: 700;
  margin-right: 2px;
}

.keyword-sub {
  font-size: 0.78em;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.3;
  word-break: break-word;
}

.keyword-mult {
  font-size: 0.85em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.keyword-mult.mult-high {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.keyword-mult.mult-neutral {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c084fc;
}

.keyword-mult.mult-low {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

.keyword-mult.mult-unmeasured {
  background: rgba(51, 65, 85, 0.35);
  border: 1px solid rgba(71, 85, 105, 0.4);
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.keyword-card.card-unmeasured {
  opacity: 0.72;
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(15, 23, 42, 0.35);
  transition: opacity 0.2s, background 0.2s;
}

.keyword-card.card-unmeasured:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.6);
}

.sub-unmeasured {
  color: #64748b;
}

.stats-back-nav {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 40px;
}

.stats-back-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  transition: background 0.3s;
  border: 1px solid #555;
}

.stats-back-btn:hover {
  background: #555;
}

/* =========================================================
   歴代ランキング TOP10 リストスタイル
========================================================= */
.mobile-only-tabs {
  display: none;
}

.top-rankings-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: flex-start;
}

.ranking-list-wrap {
  flex: 1;
  min-width: 0;
}

.ranking-col-title {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 12px;
  text-align: center;
  font-weight: bold;
  background-color: #1e1e1e;
  padding: 8px;
  border-radius: 6px;
  display: block;
}

.top-streams-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-stream-item {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: #2a2a2a;
  border-radius: 8px;
  border: 1px solid #3a3a3a;
  transition: background-color 0.2s, transform 0.2s, border-color 0.2s;
}

.top-stream-item:hover {
  background-color: #333;
  border-color: #555;
  transform: translateY(-2px);
}

.top-stream-thumb {
  width: 140px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  margin-right: 15px;
  flex-shrink: 0;
  display: block;
  border: 1px solid #222;
}

.top-stream-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.top-stream-thumb:hover img {
  transform: scale(1.05);
}

.top-stream-info {
  flex: 1;
  min-width: 0;
  padding-right: 10px;
}

.top-stream-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  color: #eee;
  font-weight: bold;
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
  margin-bottom: 4px;
  word-wrap: break-word;
}

.top-stream-meta {
  font-size: 0.8rem;
  color: #aaa;
}

.top-stream-viewers-box {
  text-align: right;
  flex-shrink: 0;
  min-width: 80px;
}

.top-stream-viewers-label {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 2px;
}

.top-stream-viewers-val {
  font-size: 1.4rem;
  font-weight: bold;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.theme-viewers .ranking-col-title {
  color: #ff4081;
  border-bottom: 2px solid #ff4081;
}

.theme-viewers .top-stream-viewers-val {
  color: #ff4081;
}

.theme-viewers .top-stream-title:hover {
  color: #ff4081;
}

.theme-likes .ranking-col-title {
  color: #2196f3;
  border-bottom: 2px solid #2196f3;
}

.theme-likes .top-stream-viewers-val {
  color: #2196f3;
}

.theme-likes .top-stream-title:hover {
  color: #2196f3;
}

.theme-views .ranking-col-title {
  color: #10b981;
  border-bottom: 2px solid #10b981;
}

.theme-views .top-stream-viewers-val {
  color: #10b981;
}

.theme-views .top-stream-title:hover {
  color: #10b981;
}

/* =========================================
   データ空表示用メッセージ
   ========================================= */
.stat-empty-msg {
  text-align: center;
  padding: 40px 0;
  color: #888;
}

/* ==========================================================
   レスポンシブ設定 (Responsive Design)
========================================================== */

@media screen and (max-width: 1200px) {
  .stats-container {
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .rankings-grid {
    display: block;
  }

  .ranking-section {
    width: 100%;
    margin-bottom: 30px;
    box-sizing: border-box;
  }

  .month-title-btn {
    font-size: 1.6rem;
    gap: 8px;
  }

  .month-title-btn .chevron {
    font-size: 1rem;
  }

  .stats-tab-container {
    display: flex;
    flex-direction: row;
    width: 95%;
    max-width: 480px;
    margin: 10px auto 30px auto;
    gap: 6px;
    padding: 6px;
    box-sizing: border-box;
  }

  .stats-tab-btn {
    flex: 1;
    width: auto;
    padding: 10px 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
  }

  .stats-header-row {
    flex-wrap: wrap;
    box-sizing: border-box;
  }

  .stats-subtitle {
    display: block;
    width: 100%;
    margin-top: 4px;
  }

  .rank-card {
    padding: 12px 10px;
    box-sizing: border-box;
  }

  .rank-card-header {
    align-items: flex-start;
  }

  .rank-num {
    width: 30px;
    font-size: 1.2rem;
    margin-right: 8px;
    margin-top: 10px;
  }

  .rank-num.top1,
  .rank-num.top2,
  .rank-num.top3 {
    font-size: 1.4rem;
  }

  .ch-icon {
    width: 36px;
    height: 36px;
    margin-right: 10px;
  }

  .ch-name {
    font-size: 0.9rem;
  }

  .stat-value-box {
    min-width: auto;
    margin-left: 5px;
  }

  .stat-value-main {
    font-size: 1.1rem;
  }

  .stat-unit {
    font-size: 0.7rem;
  }
}

@media (max-width: 900px) {
  .stats-title-note {
    display: block;
    margin-left: 0;
    margin-top: 5px;
  }

  .mobile-only-tabs {
    display: flex;
    justify-content: center;
    margin: 10px auto 20px auto;
    gap: 6px;
    padding: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-only-tabs::-webkit-scrollbar {
    display: none;
  }

  .mobile-only-tabs .stats-tab-btn {
    flex: 1;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .top-rankings-row {
    display: block;
  }

  .ranking-col-title {
    display: none;
  }

  .top-rankings-row.show-viewers #ranking-likes,
  .top-rankings-row.show-viewers #ranking-views {
    display: none;
  }

  .top-rankings-row.show-viewers #ranking-viewers {
    display: block;
  }

  .top-rankings-row.show-likes #ranking-viewers,
  .top-rankings-row.show-likes #ranking-views {
    display: none;
  }

  .top-rankings-row.show-likes #ranking-likes {
    display: block;
  }

  .top-rankings-row.show-views #ranking-viewers,
  .top-rankings-row.show-views #ranking-likes {
    display: none;
  }

  .top-rankings-row.show-views #ranking-views {
    display: block;
  }

  .top-stream-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    padding: 12px;
    align-items: center;
  }

  .top-stream-item .rank-num {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    margin: 0;
    font-size: 1.3rem;
    text-align: left;
  }

  .top-stream-viewers-box {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    justify-self: end;
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 8px;
  }

  .top-stream-thumb {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    margin: 0;
    border-radius: 4px;
  }

  .top-stream-info {
    grid-column: 2;
    grid-row: 2;
    padding: 0;
    min-width: 0;
  }

  .top-stream-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }

  .top-stream-meta {
    font-size: 0.8rem;
  }

  .top-stream-viewers-label {
    font-size: 0.75rem;
    margin-bottom: 0;
  }

  .top-stream-viewers-val {
    font-size: 1.3rem;
  }
}

@media (max-width: 768px) {
  details.accordion-group {
    margin-bottom: 12px;
  }

  .accordion-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
  }

  .accordion-controls-title {
    font-size: 1.05em;
  }

  .accordion-btn-group {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .btn-toggle-accordion {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.85em;
  }

  .chart-container-responsive,
  .stats-chart-area {
    height: 270px;
  }

  #chartQuadrant.chart-container-responsive {
    height: 300px !important;
  }

  details.accordion-group summary {
    padding: 12px 14px;
    font-size: 1.0em;
  }

  .accordion-content {
    padding: 10px;
  }

  .stats-chart-card {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .stats-chart-title {
    font-size: 0.92em;
    margin-bottom: 6px;
  }

  .stats-charts-grid-2col,
  .stats-charts-grid-3col {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stats-section-block {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
  }

  .keyword-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
  }

  .genre-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .keyword-card {
    padding: 8px 10px;
    gap: 6px;
  }

  .keyword-name {
    font-size: 0.86em;
  }

  .keyword-sub {
    font-size: 0.74em;
  }

  .keyword-mult {
    font-size: 0.78em;
    padding: 2px 7px;
  }

  .genre-detail-card {
    padding: 8px 10px;
  }

  .genre-title {
    font-size: 0.85em;
  }

  .genre-meta-row {
    gap: 6px;
    font-size: 0.74em;
  }
}

@media (max-width: 450px) {
  .stats-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .stats-chart-title {
    font-size: 14px;
  }

  .top-stream-item {
    grid-template-columns: 90px 1fr;
  }

  .top-stream-title {
    font-size: 0.85rem;
  }
}

/* --- アコーディオンのカテゴリ属性バッジ ＆ 説明通知ボックス --- */
.summary-title-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.accordion-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 9999px;
  margin: 0;
  font-weight: 600;
  vertical-align: middle;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-archive {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}

.badge-live {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.15);
}

.stats-notice-box {
  background: rgba(15, 23, 42, 0.65);
  border-left: 3px solid #3b82f6;
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 0.84rem;
  color: #94a3b8;
  margin-bottom: 18px;
  line-height: 1.5;
  backdrop-filter: blur(4px);
}

#acc-group-live .stats-notice-box {
  border-left-color: #f97316;
}

@media (max-width: 600px) {
  .summary-title-wrap {
    gap: 6px;
  }
  .accordion-badge {
    margin: 0;
    font-size: 0.68rem;
    padding: 2px 7px;
  }
}