:root {
  --bg: #f5f1e8;
  --paper: #fffdf8;
  --ink: #17181b;
  --muted: #6b6a66;
  --line: #e2dccd;
  --line-strong: #17181b;
  --end: #d93a2b;
  --end-bg: #fde9e5;
  --start: #1f8a4c;
  --start-bg: #e3f4e9;
  --today: #fff2b8;
  --header: #14161a;
  --header-ink: #f5f1e8;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214;
    --paper: #1a1c1f;
    --ink: #ecebe6;
    --muted: #9a9993;
    --line: #2c2e33;
    --line-strong: #ecebe6;
    --end: #ff6b5b;
    --end-bg: #3a1c19;
    --start: #4fd486;
    --start-bg: #15301f;
    --today: #3d3511;
    --header: #08090a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.top { background: var(--header); color: var(--header-ink); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 52px; }
.logo { font-weight: 800; text-decoration: none; letter-spacing: .02em; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.logo-mark { color: #ff4d3d; font-size: 18px; }
.top nav { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; font-size: 13px; }
.top nav a { text-decoration: none; opacity: .75; white-space: nowrap; }
.top nav a:hover { opacity: 1; }

/* ヒーロー */
.hero { padding: 36px 0 20px; }
.hero-sm { padding: 24px 0 8px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.hero h1 { margin: 0; font-size: clamp(26px, 5vw, 42px); line-height: 1.25; font-weight: 900; letter-spacing: -.01em; }
.hero-sm h1 { font-size: clamp(22px, 4vw, 32px); }
.hl-end { color: var(--end); }
.hl-start { color: var(--start); }
.lead { margin: 12px 0 0; color: var(--muted); max-width: 46em; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.stats { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.stats li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.stats li .svc { margin-right: auto; }
.stats b { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--paper); text-decoration: none; font-weight: 700; font-size: 14px; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-x { background: var(--ink); color: var(--paper); }
.btn-x:hover { opacity: .85; background: var(--ink); color: var(--paper); }
.cta { display: block; margin-top: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--start); color: #fff; font-weight: 800; text-align: center; text-decoration: none; }
.cta small { font-weight: 500; opacity: .8; margin-left: 6px; }

/* サービスバッジ */
.svc { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--c); color: var(--ink, #fff); font-size: 11px; font-weight: 800; line-height: 1.6; white-space: nowrap; }

/* 絞り込み */
.filter { position: sticky; top: 52px; z-index: 10; background: var(--bg); padding: 10px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.filter-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.chip { font: inherit; font-size: 13px; font-weight: 800; padding: 5px 12px; min-height: 34px; border-radius: 999px; border: 2px solid var(--c); background: var(--c); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="false"] { background: transparent; color: var(--muted); border-color: var(--line); text-decoration: line-through; }

/* パネル */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 20px 0; }
.panel h2 { margin: 0 0 6px; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); flex: none; }
.dot-end { background: var(--end); }
.dot-start { background: var(--start); }
.note { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.k-end { color: var(--end); }
.k-start { color: var(--start); }
.empty-msg { color: var(--muted); }

/* もうすぐ終了 / 新作 リスト */
.soon, .news { list-style: none; margin: 0; padding: 0; }
.soon li, .news li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.soon li:first-child, .news li:first-child { border-top: 0; }
.soon a, .news a { font-weight: 700; text-decoration: none; flex: 1 1 14em; min-width: 0; }
.soon a:hover, .news a:hover { text-decoration: underline; }
.left { flex: none; width: 5.6em; text-align: center; font-size: 12px; font-weight: 800; padding: 3px 0; border-radius: 6px; background: var(--end-bg); color: var(--end); font-variant-numeric: tabular-nums; }
.left.urgent { background: var(--end); color: #fff; }
.when { flex: none; width: 3.4em; font-weight: 800; color: var(--start); font-variant-numeric: tabular-nums; }
.genre { font-size: 12px; color: var(--muted); }
.orig { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }

/* 番組表 */
.guide-wrap { border: 1.5px solid var(--line-strong); border-radius: var(--radius); }
.guide { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 13px; }
.guide th, .guide td { border: 1px solid var(--line); vertical-align: top; padding: 6px; text-align: left; }
.guide thead th { position: sticky; top: 104px; z-index: 5; background: var(--c, var(--header)); color: var(--ink, var(--header-ink)); font-size: 13px; font-weight: 800; text-align: center; border-color: transparent; }
.guide thead th.day { background: var(--header); color: var(--header-ink); }
.guide th.day { width: 56px; text-align: center; font-size: 18px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.guide th.day small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.guide tr.wd0 th.day { color: var(--end); }
.guide tr.wd6 th.day { color: #2f6fd6; }
.guide tr.today th, .guide tr.today td { background: var(--today); }
.guide tr.past { opacity: .45; }
.ev { display: block; text-decoration: none; padding: 4px 6px; margin-bottom: 4px; border-radius: 5px; line-height: 1.35; border-left: 3px solid; }
.ev b { font-size: 10px; margin-right: 4px; }
.ev-end { background: var(--end-bg); border-color: var(--end); }
.ev-end b { color: var(--end); }
.ev-start { background: var(--start-bg); border-color: var(--start); }
.ev-start b { color: var(--start); }
.ev:hover { filter: brightness(.95); }

/* 作品ページ */
.crumbs { font-size: 12px; color: var(--muted); padding-top: 16px; }
.crumbs a { color: var(--muted); }
.evcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 16px 0; }
.evcard { background: var(--paper); border: 1px solid var(--line); border-top: 5px solid var(--start); border-radius: 12px; padding: 16px; }
.evcard.ev-end { border-top-color: var(--end); }
.evcard-head { display: flex; align-items: center; gap: 8px; }
.evtype { font-weight: 800; font-size: 13px; }
.evdate { font-size: 22px; font-weight: 900; margin: 8px 0 4px; }
.left.big { width: auto; display: inline-block; padding: 4px 12px; font-size: 14px; margin: 0 0 8px; }
.evcard-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.evcard-actions .btn { font-size: 13px; min-height: 36px; padding: 6px 12px; }
.src { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.ics { padding-left: 1.2em; }
.ics li { margin: 4px 0; }
.prose h1 { font-size: 24px; margin-top: 0; }
.prose h2 { font-size: 17px; margin-top: 22px; }
.ad { margin: 20px 0; min-height: 100px; }

.foot { margin-top: 40px; padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* スマホ：番組表を日付ごとのカードに組み替える */
@media (max-width: 720px) {
  .panel { padding: 16px; }
  .guide-wrap { border: 0; overflow: visible; }
  .guide, .guide tbody, .guide tr, .guide td, .guide th { display: block; min-width: 0; width: auto; }
  .guide { min-width: 0; }
  .guide thead { display: none; }
  .guide tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; padding: 8px 10px; display: grid; grid-template-columns: 44px 1fr; column-gap: 10px; }
  .guide tr.past { display: none; }
  .guide th.day { grid-row: span 6; border: 0; padding: 2px 0; width: auto; }
  .guide td { border: 0; padding: 2px 0; }
  .guide td.empty { display: none; }
  .guide td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 800; color: var(--muted); }
  .guide tr:not(:has(td:not(.empty))) { display: none; }
}

/* 「すべて表示」で開くリスト（絞り込み後に見えている先頭20件だけ表示） */
.collapsed > li:not(:nth-child(-n+20)) { display: none; }
.more-btn { margin-top: 12px; width: 100%; }
@media (max-width: 720px) {
  .filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .filter-label { white-space: nowrap; }
  .chip { flex: none; font-size: 12px; min-height: 32px; padding: 4px 10px; }
  .guide thead th { top: 104px; }
}

/* 週間番組表 */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wk-day { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.wk-day h3 { margin: 0; padding: 6px 8px; background: var(--header); color: var(--header-ink); font-size: 14px; display: flex; gap: 6px; align-items: baseline; }
.wk-day h3 span { font-variant-numeric: tabular-nums; }
.wk-day.today h3 { background: var(--end); }
.wk-day.past { opacity: .5; }
.wk-day ul { list-style: none; margin: 0; padding: 0 8px; }
.wk-day .empty-msg { margin: 8px; font-size: 12px; }
.wk-day .wk-item { display: block; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.4; }
.wk-day .wk-item:first-child { border-top: 0; }
.wk-day .wk-title { display: block; margin: 2px 0 4px; }
.wk-list { list-style: none; margin: 0 0 8px; padding: 0; }
.wk-list .wk-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.wk-list .wk-item:first-child { border-top: 0; }
.wk-list .wk-title { flex: 1 1 12em; min-width: 0; }
.wk-time { font-size: 12px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-list .wk-time { width: 5.5em; flex: none; }
.wk-title { font-weight: 700; text-decoration: none; }
.wk-title:hover { text-decoration: underline; }
.wk-svcs { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wk-sv { display: inline-flex; align-items: center; gap: 3px; }
.wk-t { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-item.svc-hidden { display: none; }
.tag { font-size: 10px; font-weight: 800; border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
.tag-first { background: var(--start); color: #fff; }
.tag-last { background: var(--end); color: #fff; }
.wd-head { font-size: 14px; margin: 16px 0 4px; padding-bottom: 4px; border-bottom: 2px solid var(--line-strong); }
.wd-head:first-of-type { margin-top: 0; }
.more-link { margin: 12px 0 0; }
.gchip { --c: var(--header); --ink: var(--header-ink); }
.genre-filter .gchip[aria-pressed="false"] { text-decoration: none; }
.genre-filter + .filter { top: 104px; }
.svc-index { list-style: none; margin: 0; padding: 0; }
.svc-index li { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.svc-index li:first-child { border-top: 0; }
.svc-index a { width: 9em; text-decoration: none; }
.svc-index .svc { font-size: 13px; padding: 3px 10px; }
@media (max-width: 960px) {
  .week { grid-template-columns: 1fr; }
  .wk-day ul { padding: 0 12px; }
  .wk-day .wk-item { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
  .wk-day .wk-title { flex: 1 1 12em; margin: 0; }
  .wk-day .wk-time { width: 4.2em; }
}
@media (max-width: 720px) {
  .genre-filter + .filter { position: static; }
}
