/* timeline.css: 時間割の枠: 時刻の目盛り、劇場の角ボタン、行、劇場名の列とそのメニュー、空き・映画祭のチップ、
   行のドラッグ、帯。 */
/* ---------- timeline ---------- */
/* 上の線は目盛り (.ruler) が持つ。 */
/* 横のスクロールバーは出さない: 目盛りの下の細いバー（.daymap）が同じ位置を示し、つまんで動かせる。2本あると太さの
   違うバーが上下に並んで見えた（ブラウザ標準の白い太いバーはダークで浮いた。2026-11-28）。縦の時間割と同じ。 */
.timeline { position: relative; overflow-x: auto; background: var(--surface);
  border-bottom: 1px solid var(--line-strong); scrollbar-width: none; }
.timeline::-webkit-scrollbar { display: none; }
.grid { position: relative; }
/* 時刻の目盛りはスクロールする時間割の外にあり、ヘッダーの下に貼り付けられる。
   横位置は時間割のスクロールに付いてくる。 */
/* 1px 上にずらして貼り付け、自分の上の線とヘッダーの下の線を1本にする。高さは角にある2行の劇場ボタンが入るだけ。
   目盛りは時間割のスクローラーの外にある: その上の横スワイプは時間割へ渡す (js/boot.js)。 */
.ruler { position: sticky; top: calc(var(--top-h, 1px) - 1px); z-index: 6; transition: top var(--dur-open) var(--ease);
  height: 40px; overflow: hidden; touch-action: pan-y; background: var(--surface);
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.ruler::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; z-index: 1; width: var(--label-w);
  background: var(--surface); border-right: 1px solid var(--line); }
.ruler-in { position: relative; height: 100%; will-change: transform; }
/* 軸は1行に収める: 時刻の数字は時間帯の淡い色（朝の金色から深夜の紫へ、一緒にスクロール）の上に載せ、
   下の縁には1日分の細いスクロールバー（指の下で太くなる）と、選んだ上映回の点を置く。 */
.ruler .hours { height: 100%; }
/* 時間帯を、時刻の上の縁に沿った1本の連続した線で示し、一緒にスクロールする: 朝の金、昼の空、夕方のオレンジ、
   夜の藍。 */
.ruler .hours::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--tod-line); }
/* 劇場ボタンは角のセル全体で、隣の目盛りと同じくフラット。何をするかを書き、次に今の状態を書く。 */
.sort-btn { position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; width: var(--label-w); padding: 0 6px 0 38px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; border: 0;
  background: none; color: var(--ink); font-family: var(--font-ja); text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; }
.sort-btn .do { display: flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 400; line-height: 1.1; }
.sort-btn .do svg { width: 12px; height: 12px; flex: none; margin-left: 2px; translate: 0 1px; opacity: .7; }
/* アイコンは2行の横の真ん中に置き、アイコンと2行を一つのボタンに読ませる。 */
.sort-btn .do svg.lead { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 20px; height: 20px;
  margin: 0; opacity: 1; }
/* 件数はアイコンの下ではなく「劇場」の下に揃え、二行が横のアイコンの一つのラベルに読めるようにする。 */
.sort-btn .st { font-size: 10.5px; color: var(--muted); line-height: 1.1; }
.sort-btn .st b { color: var(--accent); font-weight: 700; }
/* ホバーは、ホバーのある環境だけ: スマホでは、タップしたボタンがメニューを閉じたあとも色が残ってしまう。 */
@media (hover: hover) { .sort-btn:hover { background: var(--surface-2); } }
.sort-btn:active { background: var(--surface-2); }
@media (max-width: 600px) { .sort-btn { padding: 0 6px 0 36px; gap: 4px; } .sort-btn .do svg.lead { left: 9px;
  } .sort-btn .do { font-size: 13px; } .sort-btn .st { font-size: 11px; } }
.sort-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.label-menu button[aria-checked="true"] { font-weight: 700; }
.label-menu button[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--accent); }
.daymap { position: absolute; left: var(--label-w); right: 0; bottom: 0; z-index: 2; height: 12px; padding: 0 8px;
  display: flex; align-items: flex-end; cursor: ew-resize; touch-action: none; }
.daymap:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.daymap-track { position: relative; display: block; width: 100%; height: 2px; margin-bottom: 2px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink) 12%, transparent); transition: height var(--dur-quick) var(--ease); }
.daymap:hover .daymap-track, .daymap.active .daymap-track, .daymap:focus-visible .daymap-track { height: 5px; }
.daymap-track .win { position: absolute; top: 0; bottom: 0; border-radius: var(--radius-sm); background: var(--ink); opacity: .55; }
.daymap-track .pick { position: absolute; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1.5px var(--surface); }
:root { --tod-morning: #e5b53c; --tod-day: #6fb3d6; --tod-evening: #e2814a; --tod-night: #3d4a8c; --tod-late: #2a2140; }
:root[data-theme="dark"] { --tod-morning: #d9a92e; --tod-day: #4f93b8; --tod-evening: #d0703a; --tod-night: #5867b8;
  --tod-late: #6c5a9c; }
/* データが来る前: 目盛りは仮の線で場所を保ち、操作は隠す（骨組みのルールを参照）。 */
.ruler:has(.hours:empty) .sort-btn, .ruler:has(.hours:empty) .daymap { visibility: hidden; }
@media (min-width: 900px) {
  .ruler { margin: 0 16px; border: 1px solid var(--line-strong); border-bottom-color: var(--line);
    border-radius: var(--radius) var(--radius) 0 0; }
  .timeline { margin: 0 16px; border: 1px solid var(--line-strong); border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius); }
}
.hours { position: relative; height: 26px; margin-left: var(--label-w); }
.hours span { position: absolute; top: 6px; font-size: 11px; color: var(--muted); transform: translateX(-50%); }
.row { position: relative; height: var(--row-h); border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  transition: translate var(--dur-open) var(--ease); }
/* 画面外の行はスクロールで近づくまでレイアウトと描画を省く（高さは固定なので、跳ねない）。 */
.grid > .row { content-visibility: auto; contain-intrinsic-size: auto var(--row-h); }
.row:first-child { border-top: 0; }
.label { position: sticky; left: 0; z-index: 3; width: var(--label-w); height: 100%;
  background: var(--surface); border-right: 1px solid var(--line); padding: 6px 10px 6px 14px;
  font-family: var(--font-ja); font-size: 12px; font-weight: var(--label-weight); line-height: 1.35;
  display: flex; flex-direction: column; justify-content: center;
  /* 名前は、スクレイパーが short_name に入れたゼロ幅スペースでだけ折り返す。 */
  word-break: keep-all; overflow-wrap: anywhere; }
.label small { font-weight: var(--ja-light); color: var(--muted); font-size: 10.5px; }
/* 取得が止まった劇場（#267）の「11/29 時点」。名前の下に小さく、目に入る色で。 */
.label small.stale { color: var(--ng); }
/* コンパクトの行は低く、3行目が入らない。詳細の注意書きで足りる。 */
:root[data-density="compact"] .label small.stale { display: none; }
/* スマホ: 名前の列を狭くする。short_name（ゼロ幅スペースの区切り入り）なら2行に収まる。コンパクトの行は
   abbr（イメフォ、ヴェーラ…）を使う。メニューには正式名を出す。 */
.label .abbr { display: none; }
@media (max-width: 600px) {
  :root { --label-w: 80px; }
  .label { padding: 6px 6px 6px 12px; }
  /* ふつうの行は正式名を2行に収められる。コンパクトの行は低すぎるため abbr を使う。 */
  :root[data-density="compact"] .label .full { display: none; }
  :root[data-density="compact"] .label .abbr { display: block; word-break: keep-all; overflow-wrap: normal; }
}
/* 劇場名を押すとその劇場のメニューが開く（この館だけ / 隠す / 公式サイト）。 */
.label[data-label] { cursor: pointer; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.label[data-label]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: hover) { .label[data-label]:hover { background: var(--surface-2); } }
.label-menu { position: fixed; z-index: 45; min-width: 200px; padding: 6px; background: var(--surface);
  color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-3); font-family: var(--font-ja); font-size: 13px; }
.label-menu[hidden] { display: none; }
.label-menu b { display: block; padding: 6px 10px 8px; font-size: 12px; color: var(--muted); font-weight: 500;
  border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.label-menu button, .label-menu a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: var(--radius); background: none; color: inherit; font: inherit; text-align: left;
  text-decoration: none; cursor: pointer; }
.label-menu button:hover, .label-menu a:hover, .label-menu :focus-visible { background: var(--surface-2); outline: none;
  }
.label-menu svg { width: 15px; height: 15px; color: var(--muted); }
.label::before { content: ""; position: absolute; left: 6px; top: 50%; width: 5px; height: 5px; border-radius: 50%;
  background: var(--tc); transform: translateY(-50%); }
.row.idle { height: 36px; }
/* この日に上映のない劇場は行の下に置く: チップを2行にして、見える幅に固定する。 */
/* 時間割の上に1行、横スクロールで並べる。データが来る前や全劇場に上映があるときも高さは保ち、
   時間割が跳ねないようにする。 */
.idle-group { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px 8px; overflow-x: auto;
  overflow-y: hidden; scrollbar-width: none; font-family: var(--font-ja); white-space: nowrap; }
.idle-group::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .idle-group { padding-inline: 18px; } }
/* 日付の帯と同じ: 先にまだチップがある側の端を薄くし、スマホでスクロールできると読めるようにする。 */
.idle-group.more-r { -webkit-mask: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
  mask: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
.idle-group.more-l:not(.more-r) { -webkit-mask: linear-gradient(90deg, transparent, #000 40px);
  mask: linear-gradient(90deg, transparent, #000 40px); }
.idle-wrap { position: relative; }
.idle-next { position: absolute; right: 6px; top: 2px; width: 28px; height: 28px; display: none; place-items: center;
  padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--ink);
  cursor: pointer; }
.idle-next svg { width: 14px; height: 14px; rotate: -90deg; }
.idle-wrap:has(.idle-group.more-r) .idle-next { display: grid; }
.idle-group.more-l.more-r { -webkit-mask: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 56px),
  transparent); mask: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 56px), transparent); }
.idle-line { display: flex; align-items: center; gap: 6px; flex: none; }
.idle-line + .idle-line { margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--line); }
.idle-what { flex: none; font-size: 11px; color: var(--muted); }
.idle-chip { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--ink); font: inherit;
  font-size: 12px; cursor: pointer; }
.idle-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--tc); flex: none; }
/* 開催中の映画祭: 空きのチップより暖かい色で、行の先頭に置く。 */
.fest-chip { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: none;
  color: var(--ink); font-family: var(--font-ja); font-size: 13px; cursor: pointer; white-space: nowrap; }
.fest-chip:hover { background: var(--surface-2); border-color: var(--line-strong); }
.fest-chip b { color: var(--tc); font-weight: 700; }
.fest-chip small { color: var(--muted); font-size: 11px; }
.fest-chip svg { width: 12px; height: 12px; rotate: -90deg; opacity: .7; }
.prog-chip { --tc: var(--accent); color: var(--ink); text-decoration: none; }
.fest-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.idle-line.fest + .idle-line { margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--line); }
.idle-chip small { color: var(--muted); font-size: 11px; }
.idle-chip:hover { background: var(--surface-2); border-color: var(--line-strong); }
.idle-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* まだ公開されていない: 破線。あとで埋まるため。 */
.idle-line.later .idle-chip { border-style: dashed; color: var(--muted); }
/* 劇場の行を時間割からそのままドラッグする。グリップは色の点の代わりに置く。 */
.row.lifting { z-index: 5; transition: none; box-shadow: var(--shadow-3); }
.lgrip { position: absolute; left: 0; top: 50%; translate: 0 -50%; width: 13px; height: 30px; display: grid;
  place-items: center; color: var(--tc); cursor: grab; touch-action: none; opacity: 0;
  transition: opacity var(--dur-quick) var(--ease); }
.lgrip svg { width: 12px; height: 14px; }
@media (hover: hover) {
  .label:hover .lgrip { opacity: 1; }
  .label.has-grip:hover::before { opacity: 0; }
}
@media (hover: none) {
  .lgrip { opacity: 1; }
  .label.has-grip::before { display: none; }
}
.row.lifting .lgrip { cursor: grabbing; opacity: 1; }
.grid.reordering .ladder-wrap { opacity: 0; }
.row.idle .label { flex-direction: row; align-items: center; gap: 10px; width: max-content; border-right: 0;
  white-space: nowrap; }
.track { position: absolute; top: 0; bottom: 0; left: var(--label-w); }
.vline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .6; }
.now { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--accent); z-index: 2; }
.now::before { content: ""; position: absolute; top: 0; left: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); }

.row.has-band { height: calc(var(--row-h) + 20px); }
.row.has-band .show { top: 26px; }
.band { position: absolute; top: 6px; height: 16px; display: flex; align-items: center; gap: 6px;
  font-family: var(--font-ja); font-weight: var(--ja-light); font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; }
.band::before { content: ""; flex: none; width: 8px; height: 1px; background: var(--tc); }
.band::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--tc) 40%, transparent);
  min-width: 8px; }
.band span { overflow: hidden; text-overflow: ellipsis; }
/* 映画祭の行: 名前の列をその色で薄く染め、小さな 🎬 映画祭 のタグを付ける。 */
.label.fest { background: color-mix(in srgb, var(--tc) 16%, var(--surface)); }
.label .fest-tag { display: block; margin-bottom: 2px; color: var(--tc); font-size: 10.5px; font-weight: 700;
  white-space: nowrap; }
.label.fest .full, .label.fest .abbr { white-space: nowrap; letter-spacing: -.04em; font-size: .88em; }
/* さがしている言葉に合う回の時間帯（js/boot.js の drawDaymap）。表示中の範囲（.win）より下に、太めに置く。 */
.daymap-track .hitm { position: absolute; top: -2px; bottom: -2px; min-width: 3px; border-radius: var(--radius-sm); background: var(--accent);
  opacity: .75; }
