/* 新聞のテレビ欄のように、時刻と罫線で一覧を組む。カードの重ねや淡いバッジは使わない */
/* --paper・--ink・--ink-2・--red・--band は app.js がライバーカラーの調整に読むので、#RRGGBB で書く */
:root {
  --paper: #ffffff;
  --band: #f1f0ec;
  --ink: #161616;
  --ink-2: #555555;
  --ink-3: #6a6a6a;
  --rule: #e2e0db;
  --red: #d0271d;
  --red-bg: #d0271d;
  --on-ink: #ffffff;
  --focus: #1f63d8;
  /* 罫線・選択中の印・押した状態の塗り。1人のタブではライバーカラーに差し替える（app.js の applyTint） */
  --accent: var(--ink);
  --accent-fill: var(--ink);
  --on-accent: var(--on-ink);
  --nav-h: 56px;
  --tabs-h: 46px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131313;
    --band: #1e1e1d;
    --ink: #ecebe7;
    --ink-2: #a9a8a3;
    --ink-3: #8e8d89;
    --rule: #2c2c2a;
    --red: #ff6a5f;
    --red-bg: #c9271d;
    --on-ink: #131313;
    --focus: #7aa7ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  line-break: strict;        /* 行頭に「ー」「っ」などが来ないように */
  text-autospace: normal;    /* 日本語と英数字の間に少しだけ間を空ける（対応ブラウザのみ） */
}
/* 動画の題名と、中央ぞろえのページ下の注記は、文節の切れ目で改行する（語の途中で割れると読みにくいため）。
   文節での改行（auto-phrase）に対応していないブラウザ（iPhone の Safari など）では、app.js が文節らしい切れ目に <wbr> を入れ、
   .wbr-phrase のときは、その切れ目（と空白・句読点）以外では改行しない。最後の行に1〜2文字だけ残らないようにする（対応ブラウザのみ）
   ※ 対象を変えるときは app.js の PHRASE_SELECTOR も合わせる */
:is(.title, .pov-title, .foot p) {
  word-break: auto-phrase;
}
.wbr-phrase :is(.title, .pov-title, .foot p) {
  word-break: keep-all; overflow-wrap: break-word;   /* 切れ目の無い長い語だけは、はみ出さないよう途中で折る */
  /* iPhone の Safari は、pretty で行を短く組み直すとき、文節の切れ目ではなく語の途中（「印（｜あとで見る）」のように「（」の直後など）で
     割ることがあった（2026-09-26）。文節で区切っていれば最後の行が1文字だけになることはまず無いので、ここでは使わない */
  text-wrap: wrap;
}
:is(.title, .pov-title, .foot p) {
  text-wrap: pretty;
}
/* 説明の文章（このサイトについて・設定の説明・案内・プライバシーポリシーの本文など）は、普通に折り返して行いっぱいまで詰める
   （2026-09-27。文節の切れ目でしか改行しないと、行の右端が平均3.5字ぶん空いてまばらに見えたため）。
   両端ぞろえ（justify）は、行の頭に来てはいけない字や英単語の都合で行ごとに字の間が 0〜2.3px（14px の字で最大16%）
   ばらついて見えたのでやめた。text-wrap: pretty も使わない：Safari は段落全体の行の長さをそろえようとして、
   どの行も右に1/4ほど空きが出ていた（2026-09-26。Chrome は最後の数行しか直さないので目立たなかった） */
:is(.lead, .notes li, .howto dd, .none, .empty-state p, .fine, .picker-lead, .older-guide p, .status.warn, .doc p, .doc li) {
  text-wrap: wrap;
}
.doc p, .doc li { text-align: start; }
[tabindex="-1"]:focus { outline: none; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
/* 途中で改行させたくない語（「にじさんじプロジェクト」が「及びに｜じさんじ」と割れないように） */
.nobr { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- 上の帯・画面の切り替え ---------- */

.bar { border-bottom: 2px solid var(--accent); }
.bar-in { display: flex; align-items: center; gap: 12px; max-width: 720px; min-height: 54px; margin: 0 auto; padding: 6px 16px; }
/* サイト名（押すとホームへ）。すぐ横に「非公式ファンサイト」、下にサブタイトル */
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; }
/* サイト名の左の印（ホーム画面のアイコン・共有カードと同じチェック）。見た人に同じサイトと覚えてもらう */
.brand-icon { flex: none; width: 30px; height: 30px; border-radius: 6px; }
/* ダークでは黒い四角が背景に溶けるので、縁取りで形を見せる（縁と背景の比 約3:1） */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-icon { box-shadow: 0 0 0 1.5px rgb(255 255 255 / .4); } }
.brand-text { display: block; min-width: 0; }
.brand-top { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand .name { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .02em; line-height: 1.55; }
.unofficial { font-size: 11px; color: var(--ink-2); }
.brand .sub { display: block; margin-top: 1px; font-size: 11px; color: var(--ink-2); white-space: nowrap; }
/* このサイトについて（ⓘ） */
.info-btn {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: 0 -10px 0 auto;
  border: 0; background: none; color: var(--ink); cursor: pointer;
}
.info-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.info-btn .dot { fill: currentColor; stroke: none; }

/* スマホでは画面の下に固定する */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper);
  border-top: 1px solid var(--accent);
}
.tabbar a {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; color: var(--ink-3); text-decoration: none;
}
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tabbar a[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 3px; background: var(--accent);
}

main { max-width: 720px; margin: 0 auto; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 760px) {
  main { border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); min-height: calc(100vh - 48px); }
}
/* 広い画面では上の帯に並べる */
@media (min-width: 900px) {
  .tabbar { position: static; height: auto; padding: 0; border: 0; background: none; gap: 4px; margin-left: auto; }
  .tabbar a { flex: none; flex-direction: row; gap: 6px; height: 46px; padding: 0 12px; font-size: 14px; }
  .info-btn { margin-left: 4px; }
  .tabbar svg { width: 18px; height: 18px; }
  .tabbar a[aria-current="page"]::before { top: auto; bottom: -2px; left: 12px; right: 12px; }
  main { padding-bottom: 0; }
}

/* ホーム画面から開いたときの「下に引くと更新」の案内 */
.ptr {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; z-index: 40; transform: translateX(-50%);
  margin: 0; padding: 6px 14px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper);
  font-size: 12.5px; font-weight: 700; box-shadow: 0 2px 8px rgb(0 0 0 / .15);
}
/* 「リンクをコピーしました」などの短いお知らせ（下のタブのすぐ上に少しだけ出す） */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 45;
  transform: translateX(-50%); max-width: calc(100% - 32px); margin: 0; padding: 8px 14px; border-radius: 3px;
  background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 700; overflow-wrap: anywhere;
}
@media (min-width: 900px) { .toast { bottom: 24px; } }
/* 注記のリンクの並びに置くボタン（見た目はリンクと同じ） */
.link-btn {
  padding: 0; border: 0; background: none; font: inherit; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
/* ページの先頭へ。1画面分より下にいるときだけ出す（app.js）。スマホでは下のタブのすぐ上 */
.page-top {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); z-index: 25;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1.5px solid var(--accent); border-radius: 3px; background: var(--paper); color: var(--ink);
  box-shadow: 0 2px 8px rgb(0 0 0 / .14); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.page-top.show { opacity: 1; visibility: visible; transform: none; }
.page-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; }
@media (min-width: 900px) { .page-top { bottom: 24px; right: 24px; } }
@media (prefers-reduced-motion: reduce) { .page-top { transition: none; } }

/* ---------- お気に入りの切り替え・絞り込み ---------- */

.oshi-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; height: var(--tabs-h);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
/* 横に流れる名前の並び。続きがある側の端だけ薄くする（--fade-l・--fade-r は app.js が切り替える） */
.oshi-tabs {
  --fade-l: 0px; --fade-r: 20px;
  flex: 1; display: flex; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
          mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
}
.oshi-tabs::-webkit-scrollbar { display: none; }
/* パソコン（マウスで操作する端末）では、細いスクロールバーを出してつまんで動かせるようにする（2026-10-14 に利用者の意見で追加）。
   スマホは指で横に流せるので出さない */
@media (hover: hover) and (pointer: fine) {
  .oshi-tabs { scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
  .oshi-tabs::-webkit-scrollbar { display: block; height: 6px; }
  .oshi-tabs::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 3px; }
  .oshi-tabs::-webkit-scrollbar-track { background: transparent; }
}
.oshi-tab {
  flex: none; height: 100%; padding: 3px 14px 0;
  border: 0; border-bottom: 3px solid transparent; background: none;
  font-size: 14px; color: var(--ink-2); white-space: nowrap; cursor: pointer;
}
.oshi-tab:last-child { margin-right: 20px; }
.oshi-tab[aria-pressed="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
/* ライバーカラーの見本。薄い色でも見えるよう、細い縁を付ける */
.chip {
  display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: 1px;
  background: var(--c); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .2);
}
@media (prefers-color-scheme: dark) { .chip { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .3); } }
/* 配信予定の数。赤は「配信中」と注意だけに使うので、数は灰色（赤だと未読の通知に見える） */
.oshi-tab .n { margin-left: 5px; font-size: 12px; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* 右端の ▾：お気に入りの一覧を開く（人が多くて横に収まらないとき用） */
.oshi-more {
  flex: none; display: grid; place-items: center; width: 48px;
  border: 0; border-left: 1px solid var(--rule); background: var(--paper); cursor: pointer;
}
.oshi-more svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }

/* 枠と種類の切り替え。幅 360px ほどのスマホでも1段に収まる大きさにする（入らなければ2段に折り返す） */
.filters { display: flex; flex-wrap: wrap; gap: 8px 6px; padding: 10px 16px 0; }
.seg { display: flex; border: 1.5px solid var(--accent); border-radius: 3px; overflow: hidden; }
.seg button {
  min-width: 46px; height: 38px; padding: 0 10px;
  border: 0; border-left: 1px solid var(--accent); background: var(--paper);
  font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }
/* 塗りつぶしのボタンが並んだとき（配信・動画・ショートを全部選んだときなど）も、区切りの線が見えるようにする */
.seg button[aria-pressed="true"] + button[aria-pressed="true"] {
  border-left-color: color-mix(in srgb, var(--on-accent) 55%, transparent);
}
/* 配信タイトルなどで絞り込む。広い画面では切り替えと同じ段、スマホでは次の段に全幅で */
.filters .q {
  flex: 1 1 200px; min-width: 0; height: 38px; padding: 0 10px;
  border: 1.5px solid var(--accent); border-radius: 3px; background: var(--paper);
  font-size: 16px;   /* 16px 未満だと iPhone で入力時に画面が拡大される */
}
/* 種類と検索。広い画面では枠の切り替えと同じ段に並べる（入れ物の箱は無いものとして扱う） */
.more-filters { display: contents; }
.reset-btn { flex: none; padding: 0 4px; min-height: 38px; }   /* 条件を戻す（何か絞り込んでいるときだけ出す） */
/* スマホでは「絞り込み」ボタンでたたむ。条件を足しているときは塗りつぶして「絞り込み中」 */
.filter-btn { display: none; }
@media (max-width: 599px) {
  .filter-btn {
    display: inline-flex; align-items: center; margin-left: auto; height: 38px; padding: 0 12px;
    border: 1.5px solid var(--accent); border-radius: 3px; background: var(--paper);
    font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
  }
  .filter-btn::after {
    content: ""; width: 5px; height: 5px; margin: 0 0 3px 8px;
    border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  .filter-btn[aria-expanded="true"]::after { margin-bottom: -2px; transform: rotate(-135deg); }
  .filter-btn.active { background: var(--accent-fill); color: var(--on-accent); }
  .more-filters { display: none; }
  .filters.open .more-filters { display: flex; flex-wrap: wrap; gap: 8px 6px; flex-basis: 100%; }
}
/* 表示の形（リスト・サムネ）は「配信予定」の見出しの右に小さく置く */
.seg-sm button { min-width: 0; height: 32px; padding: 0 10px; font-size: 12.5px; }
/* 幅の狭いスマホ（320px など）では、切り替えを詰める */
@media (max-width: 359px) {
  .seg button { min-width: 40px; padding: 0 8px; }
}

/* 最終更新（右に寄せる）と、更新が止まったときの注意 */
.info-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 8px 16px 0; }
.status { font-size: 11.5px; color: var(--ink-3); }
.status { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.status:empty { display: none; }
.status.warn { flex-basis: 100%; margin: 4px 0 0; padding: 8px 10px; border: 1px solid var(--red); color: var(--red); font-size: 12.5px; text-align: left; }
.status .text-btn, .none .text-btn { margin-left: 8px; color: var(--ink); }
/* 「最終更新」の横の、最新のデータを読み込むボタン（アイコンだけ。押せる広さは確保する） */
.status { display: flex; align-items: center; justify-content: flex-end; }
.status.warn { display: block; }
.refresh-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; margin: -8px -8px -8px 0; padding: 0;
  border: 0; background: none; color: var(--ink); cursor: pointer; vertical-align: middle;
}
.refresh-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
/* 小さなアイコンのボタンは、見た目の大きさはそのままで、押せる範囲だけ 44px 四方に広げる（指で押しやすく。Apple の目安 44pt） */
.refresh-btn, .later-icon { position: relative; }
.refresh-btn::after, .later-icon::after { content: ""; position: absolute; inset: -6px; }   /* 32px → 44px */
.later-icon::after { inset: -6.5px; }   /* 34px → 44px（枠線 1.5px の内側から数えるので 5 + 1.5） */

/* ---------- 見出し・日付の帯 ---------- */

.sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 16px 16px 6px; border-bottom: 2px solid var(--accent);
}
.sec-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: .04em; }
@media (max-width: 599px) { .sec-head { min-height: 50px; padding-top: 10px; } }   /* スマホでは一覧を少しでも上から */
.text-btn {
  padding: 10px 0; border: 0; background: none; cursor: pointer;   /* 押せる高さを確保する */
  font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}

.select { position: relative; display: inline-block; }
.select select {
  appearance: none; height: 38px; padding: 0 30px 0 10px;
  border: 1.5px solid var(--accent); border-radius: 3px; background: var(--paper);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.select::after {
  content: ""; position: absolute; right: 11px; top: 14px; width: 6px; height: 6px;
  border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none;
}
.range { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; padding: 10px 16px 0; border-bottom: 1px solid var(--rule); }
/* 「日付の指定をやめる」は日付の下の行の右端に（320px 幅でも日付の2つが1行に収まるよう、横には並べない） */
.range-clear { flex: 0 0 100%; min-height: 40px; padding: 0; text-align: right; }
.range input {
  flex: 1; min-width: 0; height: 36px; padding: 0 8px;
  border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper); font-size: 14px;
}
/* スマホ（指で操作する端末）では、入力する部品の字をすべて 16px 以上にする。iPhone は 16px 未満の入力欄を押すと
   画面を拡大してしまうため（2026-09-27。期間の選択 13px・日付 14px・コピーできなかったときのコード 13px が当たっていた） */
@media (pointer: coarse) {
  .select select, .range input, .code-box { font-size: 16px; }
}

/* 日付の帯は、お気に入りの切り替えのすぐ下に貼り付けて、長い一覧でも今どの日かが分かるようにする */
.day {
  position: sticky; top: var(--tabs-h); z-index: 5;
  margin: 0; padding: 4px 16px;
  background: var(--band); border-bottom: 1px solid var(--rule);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.day .rel { margin-right: 8px; color: var(--ink); }
/* あとで見るの「配信予定」「アーカイブ」の区切り（日付の帯と同じ見た目。上には貼り付けない） */
.list-band {
  margin: 0; padding: 4px 16px; background: var(--band); border-bottom: 1px solid var(--rule);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
}
/* 「今日」は赤地に白の札。帯をライバーカラーで色づけしても読みやすさが変わらないように */
.day .rel.today { padding: 1px 5px; border-radius: 2px; background: var(--ink); color: var(--on-ink); }   /* 赤は配信中だけにするので、今日は黒い札 */

/* ---------- 一覧の行 ---------- */

.row {
  position: relative;
  display: grid; grid-template-columns: 3.2em 1fr auto; column-gap: 12px;   /* 時刻 ｜ 中身 ｜ 右端の列（☆・あとで見る） */
  padding: 10px 16px 9px;   /* テレビ欄のように詰める（1画面に多く並べる） */
  border-bottom: 1px solid var(--rule);
}
.row.live { box-shadow: inset 3px 0 0 var(--red); }
@media (hover: hover) {
  .row:hover { background: var(--band); }
  .row:hover .title { text-decoration: underline; }
}
.when { font-size: 15px; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums; }
.when small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-2); }
.live-tag {
  display: inline-block; margin-bottom: 3px; padding: 1px 4px; border-radius: 2px;
  background: var(--red-bg); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; line-height: 1.5;
}
.body { min-width: 0; }
.host { font-size: 12.5px; color: var(--ink-2); }
.host b { color: var(--ink); font-weight: 400; }   /* 枠の主は色の濃さで区別し、太字は時刻と題名に絞る */
.host time { margin-right: 8px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin-top: 2px; font-size: 14.5px; font-weight: 600; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere;
}
/* 行のどこを押しても動画が開くようにする */
.title::after { content: ""; position: absolute; inset: 0; }
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px;
  margin-top: 3px; font-size: 12px; color: var(--ink-2);
}
.meta button, .pov-list { position: relative; z-index: 1; }
.meta .cast b { color: var(--ink); font-weight: 400; }
.meta .eta, .meta .before { color: var(--ink); font-weight: 700; }
.later {
  margin-left: auto; min-width: 76px; min-height: 32px; padding: 0 10px;
  border: 1.5px solid var(--accent); border-radius: 3px; background: var(--paper);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
/* 「あとで見る」（ブックマークの印）と ☆：アイコンだけの四角いボタン。入れたら印を塗る（背景は塗らない） */
.later-icon { display: grid; place-items: center; min-width: 0; width: 34px; height: 34px; padding: 0; }
.later-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
/* ☆（その人をお気に入りに追加）。入っていたら星も塗る */
.fav-btn + .later { margin-left: 0; }   /* ☆ とあとで見るは、並べて右に寄せる */
.later[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }
.later-icon[aria-pressed="true"] { background: var(--paper); color: var(--accent); }
.later-icon[aria-pressed="true"] svg { fill: currentColor; }
/* 行の右端の列：☆とあとで見るを下にそろえる。下の行を文字だけにして、1行を低くする */
.row .side { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.row .side .later { margin-left: 0; }

/* 他視点：押すと、同じ企画のほかの枠が一覧で開く */
.pov-btn {
  min-height: 32px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--ink);
}
.pov-btn::after {
  content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 0 3px 7px;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.pov-btn[aria-expanded="true"]::after { margin-bottom: -1px; transform: rotate(-135deg); }
/* 開いた他視点は行の幅いっぱいに出し、1件ずつ一覧の行と同じ組み方（誰の枠 → 題名 → 長さ・あとで見る）にする */
.pov-list {
  grid-column: 1 / -1; margin: 10px 0 0; padding: 0 0 0 12px; list-style: none;
  border-left: 2px solid var(--accent); background: var(--paper);
}
.pov-item { position: relative; display: grid; grid-template-columns: 1fr; column-gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }
.pov-item:first-child { padding-top: 2px; border-top: 0; }
.pov-item:last-child { padding-bottom: 2px; }
.pov-item.has-thumb { grid-template-columns: 96px 1fr; }
.pov-body { min-width: 0; }
.pov-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin-top: 1px; font-size: 13.5px; font-weight: 600; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere;
}
.pov-title::after { content: ""; position: absolute; inset: 0; }   /* 他視点の1件のどこを押してもその枠が開く */
@media (hover: hover) { .pov-item:hover .pov-title { text-decoration: underline; } }
.pov-item .meta { margin-top: 4px; }

/* サムネ表示（選んだときだけ）：日付ごとに格子で並べる（スマホ2列・広い画面3列）。カードの枠や影は付けず、余白で区切る */
.thumb { position: relative; align-self: start; aspect-ratio: 16 / 9; background: var(--band); overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb .live-tag { position: absolute; left: 4px; bottom: 4px; margin: 0; }
.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px;
  padding: 12px 16px 16px; border-bottom: 1px solid var(--rule);
  grid-auto-flow: row dense;   /* 他視点の一覧（全幅）を開いても、同じ段のほかの枠を前に詰める */
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* 広いパソコンの画面でグリッドを見るときは、中身の幅を広げて4列にする（余白ばかりにならないように） */
@media (min-width: 1100px) {
  body[data-view="radar"][data-layout="thumb"] :is(main, .bar-in) { max-width: 1040px; }
  body[data-view="radar"][data-layout="thumb"] .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.grid > .pov-list { grid-column: 1 / -1; margin: 0; }
/* 同じ段の枠は高さをそろえ、他視点とあとで見るの行はいつも枠のいちばん下に置く */
.tile { position: relative; min-width: 0; display: flex; flex-direction: column; }
.tile .body { flex: 1; display: flex; flex-direction: column; }
.tile .actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 6px; }   /* 隣のボタンと押せる範囲（44px）が重ならない間隔 */
.tile .thumb { border-radius: 3px; }
.tile.live .thumb { box-shadow: 0 0 0 2px var(--red); }
/* サムネの左下に時刻、右下に長さ（YouTube と同じ置き方） */
.tile .t-time, .tile .t-len {
  position: absolute; bottom: 4px; padding: 1px 5px; border-radius: 2px;
  background: rgb(0 0 0 / .75); color: #fff; font-size: 11px; font-weight: 700; line-height: 1.5;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tile .t-time { left: 4px; }
.tile .t-len { right: 4px; }
.tile .body { margin-top: 6px; }
.tile .host { font-size: 12px; }
/* 枠の題名は幅が狭いので、文節にこだわらず行いっぱいまで詰める（2行に入る文字を増やす） */
.tile .title, .wbr-phrase .tile .title { font-size: 13.5px; word-break: normal; }
.tile .meta { gap: 2px 10px; margin-top: 4px; }
/* グリッドのあとで見る（ブックマーク）はサムネの右上に重ね、写真の上でも見えるよう丸い下地を敷く。入れたら白く塗る */
.tile .later-icon.on-thumb, .tile .later-icon.on-thumb[aria-pressed="true"] {
  position: absolute; top: 4px; right: 4px; z-index: 1; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: rgb(0 0 0 / .6); color: #fff;
}
.tile .later-icon.on-thumb::after { inset: -5px; }   /* 枠線が無いので 34 + 5 × 2 = 44px */
.tile .fav-btn.on-thumb { right: auto; left: 4px; }   /* ☆（にじさんじ全体だけ）は左上 */
@media (hover: hover) { .tile:hover .title { text-decoration: underline; } }

.none { padding: 14px 16px; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--ink-3); }
/* アーカイブの最後：6か月より前は YouTube（自枠）・Holodex（他枠）へ案内する */
.older-guide { padding: 14px 16px 6px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.older-guide p { text-wrap: pretty; }
.older-guide ul { margin: 6px 0 0; padding: 0; list-style: none; }
.older-guide li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; min-height: 36px; }
.older-guide .nm { min-width: 8em; color: var(--ink); }
.older-guide a { color: var(--ink); font-weight: 700; }
/* 「もっと見る」は中央に置き、残りの件数を添える（作者のほかのサイトと同じ形）。
   .btn の inline-flex に負けて左に寄っていたので、.btn.more で指定する */
.btn.more { display: flex; gap: 8px; width: fit-content; min-width: 240px; margin: 16px auto 0; }
.more-rest { font-size: 12px; font-weight: 400; color: var(--ink-2); }

/* ---------- ボタン・はじめての表示 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px;
  border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper); color: var(--ink);
  font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.empty-state { padding: 48px 24px; text-align: center; }
.empty-state p { margin-bottom: 20px; font-size: 14px; color: var(--ink-2); }
.empty-state .btn { min-width: 200px; min-height: 48px; font-size: 15px; }

/* ---------- 設定・下の注記 ---------- */

.pad { padding: 12px 16px; }
.pad p + p { margin-top: 8px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fine { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.fine:empty { display: none; }
.order-list { margin: 0; padding: 0; list-style: none; }
.order-list li { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 16px; border-bottom: 1px solid var(--rule); }
.order-list li { background: var(--paper); }
.order-list .nm { flex: 1; min-width: 0; font-size: 15px; }
/* 行の「外す」「先頭へ」。押しやすいよう左右にも余白を取る */
.order-list .row-btn { flex: none; padding: 10px 6px; font-size: 12.5px; font-weight: 400; color: var(--ink-2); }
.order-list .ghost { visibility: hidden; }
.order-msg { padding: 10px 16px 0; }
.order-msg .text-btn { margin-left: 8px; color: var(--ink); }
/* 並べ替えのつまみ（≡）。つまんでいる間は行を少し浮かせる */
.grip {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px;
  border: 0; background: none; color: var(--ink-2); cursor: grab; touch-action: none;
}
.grip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.order-list li.dragging { position: relative; z-index: 2; box-shadow: 0 6px 18px rgb(0 0 0 / .2); }
.order-list li.dragging .grip { cursor: grabbing; color: var(--ink); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }

/* ページ下の注記は中央にそろえ、ページの終わりと分かるようにする（上の中身は左ぞろえのまま） */
.foot { padding: 20px 16px 24px; font-size: 11.5px; color: var(--ink-3); line-height: 1.8; text-align: center; }
.foot a { color: var(--ink-2); }
/* リンクは語の途中で折り返さず、1つずつ並べる */
.foot-links { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 6px; font-size: 11.5px; }
.foot .foot-links { justify-content: center; }
.foot-links a { white-space: nowrap; color: var(--ink-2); }
.foot-links :is(a, .link-btn) { display: inline-flex; align-items: center; min-height: 28px; }   /* 指で押しやすい高さ */
.foot .link-btn { font-size: 11.5px; }
.foot .foot-note, .foot .foot-note + .foot-meta { margin-top: 10px; }
.foot .foot-meta a { display: inline-block; padding: 6px 0; margin: -6px 0; }   /* 押せる高さを 28px に（行の高さは変えない） */
/* このサイトをシェア：X・リンクをコピー・（スマホなら）ほかのアプリで共有。四角い枠のアイコンのボタン（一覧の☆と同じ形）。
   クラス名に share・social を使わない（広告・SNS ボタンを隠すブロッカーの指定〔.share-label など〕に当たって消えるため。2026-09-27） */
.foot-cta-label { color: var(--ink-3); }
.foot-cta { display: flex; justify-content: center; gap: 12px; margin: 6px 0 12px; }
.sq-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper); color: var(--ink); cursor: pointer;
}
.sq-btn[hidden] { display: none; }
.sq-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sq-btn svg.fill { fill: currentColor; stroke: none; }
.foot .sq-btn { color: var(--ink); }

/* ---------- お気に入りの選択・このサイトについて（ダイアログ） ---------- */

dialog { max-width: none; max-height: none; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / .5); }
.dlg-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 8px 12px 8px 16px; border-bottom: 2px solid var(--ink);
}
.dlg-head h2 { margin: 0; font-size: 16px; font-weight: 800; }

#picker { width: 100%; height: 100%; margin: 0; }
#picker[open] { display: flex; flex-direction: column; }
@media (min-width: 600px) {
  #picker { width: 480px; height: min(760px, 90vh); margin: auto; border: 2px solid var(--ink); }
}
.search { padding: 10px 16px; }
.search input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper);
  font-size: 16px;
}
.picker-filter { display: flex; padding: 0 16px 10px; }
.picker-lead { margin: 0; padding: 12px 16px 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.picked { padding: 0 16px 10px; border-bottom: 1px solid var(--ink); font-size: 12.5px; color: var(--ink-2); }
/* 「すべて」のときの、にじさんじ／NIJISANJI EN の区切り */
.group-head { padding: 16px 16px 6px; border-bottom: 2px solid var(--ink); font-size: 14px; font-weight: 800; }
.liver-list { flex: 1; overflow-y: auto; margin: 0; padding: 0; list-style: none; overscroll-behavior: contain; }
.kana-head {
  position: sticky; top: 0; z-index: 1;
  padding: 3px 16px; background: var(--band); font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.pick { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.pick .nm { flex: 1; min-width: 0; font-size: 15px; }
.pick small { margin-left: 8px; font-size: 11.5px; color: var(--ink-3); }
.pick input {
  appearance: none; flex: none; display: grid; place-content: center;
  width: 24px; height: 24px; margin: 0; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper);
}
.pick input:checked { background: var(--ink); }
/* 表示しないライバーを選ぶとき、お気に入りの人は選べない（枠を薄くし、名前の横に「お気に入り」と出す） */
.pick:has(input:disabled) { cursor: default; }
.pick input:disabled { border-color: var(--rule); background: var(--band); }
.pick input:checked::after {
  content: ""; width: 6px; height: 12px; margin-top: -3px;
  border: solid var(--on-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* 表示する人の一覧：スマホでは下から出す。2列に並べ、押すとその人に切り替える */
#switcher { width: 100%; margin: auto 0 0; max-height: 85vh; border-top: 2px solid var(--ink); }
#switcher[open] { display: flex; flex-direction: column; }
@media (min-width: 600px) {
  #switcher { width: 480px; margin: auto; border: 2px solid var(--ink); }
}
/* 引き継ぎコードで復元：表示する人の一覧と同じく、スマホでは下から出す */
#restore { width: 100%; margin: auto 0 0; border-top: 2px solid var(--ink); }
@media (min-width: 600px) {
  #restore { width: 480px; margin: auto; border: 2px solid var(--ink); }
}
.restore-body { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.restore-body .fine { margin: 0 0 10px; }
.restore-body .btns { justify-content: flex-end; margin: 8px 0 0; }
.restore-body .btn { min-width: 120px; }
.restore-body .btn[disabled] { opacity: .45; cursor: default; }
/* コードの入力欄。16px 未満だと iPhone が入力のときに画面を拡大してしまうので 16px にする */
#restore-code, .code-box {
  display: block; width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper); color: var(--ink);
  font: 16px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; resize: vertical;
}
.code-box { margin-top: 8px; font-size: 13px; }
/* 引き継ぎコードのボタンは、スマホでは幅いっぱいに縦に並べる（押しやすく、長さがそろう）。広い画面では横に並べる */
.backup-btns { display: grid; gap: 8px; }
.backup-btns .btn[hidden] { display: none; }
@media (min-width: 600px) { .backup-btns { display: flex; } }
/* ファイルでの保存・復元（パソコン向け）は、文字のリンクで小さく */
.file-io { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 4px 0 0; font-size: 12.5px; }
.file-io .link-btn { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); }
.dlg-foot { margin: 0; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); }
.dlg-foot .btn { flex: 1; }
.switch-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 0; padding: 12px 16px 20px; list-style: none; overflow-y: auto; overscroll-behavior: contain;
}
.switch-list .all { grid-column: 1 / -1; }
.switch-item {
  display: flex; align-items: center; width: 100%; min-height: 48px; padding: 6px 10px;
  border: 1.5px solid var(--rule); border-radius: 3px; background: var(--paper);
  font-size: 14px; text-align: left; cursor: pointer;
}
.switch-item .nm { flex: 1; min-width: 0; word-break: auto-phrase; }
.switch-item .n { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.switch-item[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 700; }

/* このサイトについて（使い方）：後ろのサイトがうっすら見えるポップアップ。
   初めて来た人にも「どのサイトか」が分かるよう、上の帯（サイト名）にかからない位置まで下げる */
#about {
  width: min(520px, calc(100% - 32px)); height: auto;
  max-height: min(720px, calc(100vh - 104px));
  max-height: min(720px, calc(100dvh - 104px));
  margin: 80px auto 24px; border: 2px solid var(--ink);
  box-shadow: 0 8px 32px rgb(0 0 0 / .25);
}
#about[open] { display: flex; flex-direction: column; }
#about::backdrop { background: rgb(0 0 0 / .35); }
.dlg-body { flex: 1; overflow-y: auto; padding: 16px 16px 24px; overscroll-behavior: contain; }
.dlg-body h3 { margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--ink); font-size: 15px; font-weight: 800; }
.dlg-body .lead { font-size: 14px; line-height: 1.8; }
/* 使い方：見出しと説明を罫線で区切って並べる（番号の札は付けない） */
.howto { margin: 0; }
.howto dt { padding-top: 10px; font-size: 14px; font-weight: 800; }
.howto dd { margin: 2px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--rule); font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.notes { margin: 0 0 16px; padding-left: 1.2em; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.notes li + li { margin-top: 4px; }

/* ---------- プライバシーポリシーなどの文書 ---------- */

.doc { padding: 8px 16px 40px; }
/* 文書のページから、サイトの画面に戻るリンク（上と下に置く） */
.back-link {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px;
  font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
.doc h1 { margin: 20px 0 4px; font-size: 20px; font-weight: 800; }
.doc h2 { margin: 24px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--ink); font-size: 16px; font-weight: 800; }
.doc p { margin: 8px 0; font-size: 14px; line-height: 1.8; }
.doc ul { margin: 8px 0; padding-left: 1.3em; font-size: 14px; line-height: 1.8; }
.doc li + li { margin-top: 6px; }
.doc-foot { max-width: 720px; margin: 0 auto; }
