/* ==========================================================================
   音MADランキングweb 共通スタイル
   - 全ページ共通のヘッダー／ナビ／ツールバー／ランキング行
   - PC・スマホ両対応（ブレークポイント: 700px）
   ========================================================================== */

:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-hover: #f5f8fd;
  --surface-sunken: #e8ecf3;
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --accent-soft: rgba(0, 102, 204, 0.09);
  --cyan: #0e8f8f;
  --cyan-soft: rgba(14, 143, 143, 0.1);
  --gold: #d29a1f;
  --gold-soft: #fbf2dd;
  --silver: #8b97a3;
  --silver-soft: #eef1f4;
  --bronze: #c07d3e;
  --bronze-soft: #f7ecdf;
  --danger: #c0392b;
  --danger-soft: #fdf3f2;
  --danger-border: #f2d4d0;
  --text: #1c2430;
  --text-muted: #5b6673;
  --text-faint: #8b95a3;
  --border: #dfe4ec;
  --shadow-1: 0 1px 2px rgba(28, 36, 48, 0.05);
  --shadow-2: 0 4px 16px rgba(28, 36, 48, 0.1);
  --radius: 12px;
  --maxw: 960px;
  --font-display: "Teko", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
}

body { min-height: 100vh; }

a { color: inherit; }

img { max-width: 100%; }

::selection { background: var(--accent-soft); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

/* --------------------------------------------------------------------------
   サイトヘッダー（common.jsが #siteHeader に描画）
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 24px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 10px;
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.site-brand .brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}

.site-nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  min-height: 48px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent; /* 上下対称にして文字を中央に */
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--surface-hover); }
.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

/* --------------------------------------------------------------------------
   ページ見出し
   -------------------------------------------------------------------------- */
.page-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 20px 14px;
}
.page-head h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.3;
}
.page-head .page-desc {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   ツールバー（タブ・日付送りなどの操作をまとめてスティッキー表示）
   -------------------------------------------------------------------------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.toolbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

/* セグメントコントロール（期間・指標などの切り替え） */
.seg,
.toggle-group {
  display: inline-flex;
  background: var(--surface-sunken);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button,
.toggle-group button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 13px;
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s ease, background 0.12s ease;
}
.seg button:hover,
.toggle-group button:hover { color: var(--text); }
.seg button[aria-selected="true"],
.toggle-group button[aria-selected="true"] {
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(28, 36, 48, 0.12);
}

/* 日付・週の送りナビ */
.date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.btn-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.12s ease, color 0.12s ease;
}
.btn-icon:hover:not(:disabled) { background: var(--surface-hover); color: var(--accent); }
.btn-icon:disabled { opacity: 0.35; cursor: not-allowed; }

.select {
  height: 38px;
  max-width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

/* 主ボタン（管理ページ・ダウンロード等でも使用） */
.btn-primary,
.btn-refresh {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover:not(:disabled),
.btn-refresh:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active,
.btn-refresh:active { transform: translateY(1px); }
.btn-primary:disabled,
.btn-refresh:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid transparent;
  background: var(--cyan-soft);
  border-radius: 10px;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.btn-download:hover { background: rgba(14, 143, 143, 0.2); }

/* --------------------------------------------------------------------------
   メイン領域・ランキングボード
   -------------------------------------------------------------------------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px 56px;
}

/* ランキング上部のメタ情報（更新時刻・比較期間・一覧リンク） */
.board-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-bottom: 12px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  line-height: 1.7;
}
.board-meta a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 500;
}
.board-meta a:hover { text-decoration: underline; }

.state-banner {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.state-banner.error {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}
.state-banner.loading { display: flex; align-items: center; gap: 10px; }
.state-banner.loading::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.board,
.backnumber-board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ランキング1行（カード） */
.row {
  display: grid;
  grid-template-columns: 48px 120px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px 10px 10px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.row:hover {
  background: var(--surface-hover);
  border-color: #c9d4e4;
  box-shadow: var(--shadow-2);
}
.row:active { transform: scale(0.995); }

.rank-cell { text-align: center; }

.rank-num {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: var(--text-faint);
  font-weight: 600;
}

.row.top1 .rank-num { color: var(--gold); font-size: 38px; }
.row.top2 .rank-num { color: var(--silver); font-size: 34px; }
.row.top3 .rank-num { color: var(--bronze); font-size: 34px; }

.thumb-box {
  position: relative;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-sunken);
  flex: none;
}
.thumb-box .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* スマホ表示でサムネイル左上に重ねる順位バッジ（PCでは非表示） */
.rank-chip {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 0 0 8px 0;
  background: rgba(20, 27, 38, 0.82);
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.3;
  text-align: center;
}
.row.top1 .rank-chip { background: var(--gold); }
.row.top2 .rank-chip { background: var(--silver); }
.row.top3 .rank-chip { background: var(--bronze); }
.rank-chip.is-label {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 7px;
  background: var(--cyan);
}

.label-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  background: var(--cyan-soft);
  border-radius: 8px;
  padding: 4px 6px;
  min-width: 44px;
}

.row-main { min-width: 0; }

.row-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.row-owner {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}
.row-stats .stat-primary {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}
.row-stats:empty { display: none; }

.row-point {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.row-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.row-tags .tag-chip {
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.row-tags .tag-chip.locked {
  color: var(--cyan);
  border-color: transparent;
  background: var(--cyan-soft);
}

/* バックナンバーの「動画IDのみ」のシンプル行 */
.backnumber-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: background 0.12s ease;
}
.backnumber-row:hover { background: var(--surface-hover); }
.backnumber-row .rank-num {
  font-size: 24px;
  width: 44px;
  text-align: center;
  flex: none;
}
.backnumber-row.top1 .rank-num { color: var(--gold); }
.backnumber-row.top2 .rank-num { color: var(--silver); }
.backnumber-row.top3 .rank-num { color: var(--bronze); }
.backnumber-row .video-id {
  font-family: var(--font-mono);
  font-size: 13px;
}

.backnumber-week-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 4px;
  line-height: 1.8;
}
.backnumber-week-meta a { color: var(--accent); }

/* --------------------------------------------------------------------------
   トップページ（機能一覧）
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, #103a6b 0%, #0f5cad 60%, #1173d4 100%);
  color: #fff;
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 44px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.35;
}
.hero p {
  margin: 0 0 20px;
  font-size: 13.5px;
  opacity: 0.85;
  max-width: 560px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #0f5cad;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.hero-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }

.hub-list {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 20px 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hub-section-title {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.feature-card:hover {
  border-color: #c9d4e4;
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.feature-card.primary { border-left: 4px solid var(--accent); }

.feature-card .feature-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 10px;
}

.feature-card h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
}

.feature-card .feature-go {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}

/* hub-intro（管理ページ等の説明ブロック） */
.hub-intro {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 20px 0;
}
.hub-intro h2 { margin: 0 0 6px; font-size: 16px; }
.hub-intro p { margin: 0 0 4px; font-size: 12.5px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   ランキング一覧（アーカイブ）ページ
   -------------------------------------------------------------------------- */
.archive-month-group { margin-bottom: 28px; }
.archive-month-group h2 {
  font-size: 15px;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.archive-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.archive-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.archive-card:hover { box-shadow: var(--shadow-2); border-color: #c9d4e4; }
.archive-card:active { transform: scale(0.98); }

.archive-card .thumb-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-sunken);
  overflow: hidden;
}
.archive-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.archive-card .archive-card-label {
  padding: 8px 10px 2px;
  font-size: 12.5px;
  font-weight: 700;
}
.archive-card .archive-card-sub {
  padding: 0 10px 8px;
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.archive-card.date-only { padding: 16px 10px; text-align: center; }
.archive-card.date-only .archive-card-label { padding: 0; font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   管理ページ（データ登録・編集）
   -------------------------------------------------------------------------- */
.mode-row {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 0;
  flex-wrap: wrap;
}

.mad-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.import-main {
  max-width: 700px;
  margin: 0 auto;
  padding: 8px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.import-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 12px;
}

.import-week-input {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  width: 160px;
  max-width: 100%;
}

.import-textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}

.import-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 8px;
  background: var(--surface);
}
.preview-table th, .preview-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.preview-table th { background: var(--surface-hover); }
.preview-table .num-cell { font-family: var(--font-mono); text-align: right; }

/* リアルタイムランキング編集行 */
.edit-row {
  display: grid;
  grid-template-columns: 36px 80px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.edit-row .rank-num { font-size: 22px; color: var(--text-muted); text-align: center; }
.edit-row .thumb {
  width: 80px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-sunken);
}
.edit-row .row-title { font-size: 13px; -webkit-line-clamp: 2; }
.edit-row .row-owner { margin-top: 2px; font-size: 11px; white-space: normal; }
.edit-row .edit-stat {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}
.edit-row-controls { display: flex; gap: 4px; }
.edit-row-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}
.edit-row-controls button:hover:not(:disabled) { background: var(--border); }
.edit-row-controls button:disabled { opacity: 0.3; cursor: not-allowed; }
.edit-row-controls button.danger { color: var(--danger); border-color: var(--danger-border); }
.edit-row-controls button.danger:hover:not(:disabled) { background: var(--danger-soft); }

/* --------------------------------------------------------------------------
   フッター・トップに戻る
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  line-height: 1.8;
}
.site-footer a { color: var(--text-muted); }

.back-to-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.back-to-top:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   スマートフォン（〜700px）
   -------------------------------------------------------------------------- */
@media (max-width: 700px) {
  html, body { font-size: 14px; }

  .site-header-inner { padding: 0 12px; }
  .site-brand { padding: 10px 0 6px; font-size: 15px; }
  .site-nav {
    margin-left: 0;
    width: 100%;
    /* 端までスクロールできるように左右へはみ出させる */
    margin-inline: -12px;
    padding-inline: 12px;
    width: calc(100% + 24px);
  }
  .site-nav a { min-height: 44px; padding: 0 11px; font-size: 13px; }

  .page-head { padding: 16px 16px 10px; }
  .page-head h1 { font-size: 19px; }
  .page-head .page-desc { font-size: 12px; }

  .toolbar-inner { padding: 6px 12px 8px; gap: 6px; }
  /* セグメントは全幅・均等割りにして縦積み（親指で押しやすい大きさを保つ） */
  .toolbar .seg { flex: 1 1 100%; }
  .toolbar .seg button { flex: 1; }
  .seg button, .toggle-group button { padding: 6px 10px; min-height: 38px; font-size: 12.5px; }
  .btn-icon { width: 40px; height: 38px; }
  .select { height: 38px; }
  .date-nav { margin-left: 0; width: 100%; }
  .date-nav .select { flex: 1; }

  main { padding: 12px 12px 56px; }

  /* ランキング行: サムネ+順位バッジ / タイトル / 統計 の2段レイアウト */
  .row {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 10px;
  }
  .rank-cell { display: none; }
  .rank-chip { display: block; }
  .thumb-box { width: 112px; }
  .row-title { font-size: 13.5px; }
  .row-owner { font-size: 11px; white-space: normal; }
  .row-stats {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 4px 12px;
    font-size: 12px;
    padding-top: 2px;
    border-top: 1px dashed var(--border);
  }
  .row-stats .stat-primary { font-size: 13.5px; }
  .row-tags { display: none; } /* スマホではタグを省略して情報量を絞る */

  .backnumber-row { padding: 12px 14px; }

  .hero-inner { padding: 30px 16px 34px; }
  .hero h1 { font-size: 22px; }

  .hub-list { grid-template-columns: 1fr; padding: 18px 16px 48px; }

  .archive-card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

  .edit-row { grid-template-columns: 28px 64px minmax(0, 1fr) auto; }
  .edit-row .thumb { width: 64px; height: 36px; }
  .edit-row .edit-stat { display: none; }
}

/* PCでは順位バッジは非表示（左の順位数字を使う） */
@media (min-width: 701px) {
  .rank-chip { display: none !important; }
}
