/* チャートの資料室 — 使いやすさが主役（DESIGN.md 2026-11-23「裏は使いやすさが主役」）。
   表の世界の色は上の帯だけ。本体は落ち着いた地に、1 行 1 曲の詰めた表（薄い罫線・行全体が押せて 44px 以上）。
   PC（幅 960px 以上）は左に一覧・右に曲の頁の 2 列。スマホは 1 列で、曲の頁は一覧の上に重ねる。 */
:root {
  --band: #1b130e;
  --band-ink: #f6e6c8;
  --brass: #e3bd72;
  --bg: #faf8f4;
  --bg-2: #f1ede5;
  --ink: #231a14;
  --ink-2: #5b4d41;
  --rule: #e3ddd2;
  --rule-2: #cfc6b7;
  --accent: #a8361d;
  --sel: #2a1d14;
  --sel-ink: #fffaf0;
  --focus: #c25e00;
  --bar-h: 0px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- 上の帯（表の世界の色はここだけ） ---- */
.band { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 14px; background: var(--band); color: var(--band-ink); min-height: 56px; }
.band-mark { display: flex; flex: none; }
.band-mark img { display: block; }
.band-name { flex: 1; min-width: 0; }
.band h1 { margin: 0; font-size: 17px; line-height: 1.25; font-weight: 800; letter-spacing: 0.04em; color: var(--brass); }
.band-name p { margin: 0; font-size: 14px; line-height: 1.3; color: #cdb896; }
.band-back { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid rgba(246, 230, 200, 0.45); color: var(--band-ink); text-decoration: none; font-size: 16px; font-weight: 700; }
.band-lang { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--band-ink); font-size: 14px; font-weight: 700; opacity: 0.8; text-underline-offset: 3px; }
.band-lang:hover { opacity: 1; }
.band-back:hover { background: rgba(246, 230, 200, 0.12); }
.band-back:focus-visible { outline-color: var(--brass); }

/* ---- 2 列の枠 ---- */
.wrap { display: block; }
.list-col { min-width: 0; }

/* ---- 上に固定する切り替え ---- */
.bar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--rule-2); }
.bar-in { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; }
.bar-row { display: flex; gap: 8px; align-items: center; }
.yearnav { display: flex; align-items: center; flex: none; }
.yearnav button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--rule-2); background: #fff; color: var(--ink); }
.yearnav button:first-child { border-radius: 10px 0 0 10px; }
.yearnav button:last-child { border-radius: 0 10px 10px 0; }
.yearnav button:disabled { color: #b9afa2; cursor: not-allowed; background: var(--bg-2); }
.yearnav select { height: 44px; min-width: 88px; border: 1px solid var(--rule-2); border-left: 0; border-right: 0; border-radius: 0; background: #fff; padding: 0 8px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
.seg { display: flex; flex: 1; min-width: 0; border: 1px solid var(--rule-2); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { flex: 1; min-height: 44px; border: 0; background: transparent; padding: 0 10px; font-size: 16px; font-weight: 700; white-space: nowrap; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--rule-2); }
.seg button[aria-pressed="true"] { background: var(--sel); color: var(--sel-ink); }
.seg button:hover:not([aria-pressed="true"]) { background: var(--bg-2); }
.seg button:focus-visible { outline-offset: -3px; }
.search { position: relative; flex: 1.2; min-width: 0; display: flex; align-items: center; }
.search svg { position: absolute; left: 10px; color: var(--ink-2); pointer-events: none; }
.search input { width: 100%; height: 44px; border: 1px solid var(--rule-2); border-radius: 10px; background: #fff; padding: 0 40px 0 32px; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: #857767; }
#q-clear { position: absolute; right: 0; width: 44px; height: 44px; border: 0; background: transparent; font-size: 20px; color: var(--ink-2); }
.bar-foot { padding: 0 12px; }
.count { margin: 0; padding: 2px 0 4px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---- 1 行 1 曲の表 ---- */
.rows { list-style: none; margin: 0; padding: 0 0 8px; }
.row { display: grid; align-items: center; column-gap: 12px; min-height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
a.row:hover { background: var(--bg-2); }
a.row:focus-visible { outline-offset: -3px; }
a.row[aria-current="true"] { background: #efe4cf; box-shadow: inset 3px 0 0 var(--accent); }
.row.head > span { white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.row.head { min-height: 28px; padding-top: 4px; padding-bottom: 4px; border-bottom: 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.c-num { font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; font-size: 16px; }
.c-date { font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.35; color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; }
.c-title { font-weight: 700; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
.c-artist { font-size: 14px; line-height: 1.35; color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; }
.c-side { font-size: 14px; color: var(--ink-2); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.c-side b { color: var(--accent); font-weight: 800; }
/* 週間 1 位になった曲の印（★。読み上げは行の名前の「週間 1 位になった曲」） */
.tag1 { color: var(--accent); font-size: 18px; line-height: 1; }
.row.status { color: var(--ink-2); }
.row.status .c-title { font-weight: 400; font-size: 14px; }

/* スマホ: 番号・（曲名／名前の 2 段）・右の小さな事実。年間は番号の列が無い（順位を出さない。PO 2026-11-28） */
.v-year .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t s" "a s"; }
.v-week .row { grid-template-columns: 5.6em minmax(0, 1fr) auto; grid-template-areas: "d t s" "d a s"; }
/* 検索は右の札が長い（「1 位 2 週・年間ヒット（1994・1995 年）」）ので、スマホは曲名・名前の下の 3 段目に回す */
.v-search .row { grid-template-columns: 3.2em minmax(0, 1fr); grid-template-areas: "n t" "n a" "n s"; }
.v-search .c-side { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.v-search li.p .c-side { margin-left: 40px; }
.v-search .row.head .c-side { display: none; }
.row .c-num { grid-area: n; } .row .c-date { grid-area: d; } .row .c-title { grid-area: t; } .row .c-artist { grid-area: a; } .row .c-side { grid-area: s; }
.row.head .c-title, .row.head .c-artist { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.row.head > span { grid-area: auto; }
.v-year .row.head, .v-week .row.head, .v-search .row.head { grid-template-areas: none; }
.row.head .h-ta { display: block; }
.row.head .h-t, .row.head .h-a { display: none; }

.notes { padding: 0 12px; }
.notes p { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.notes p:last-child { margin-bottom: 8px; }
.more { padding: 8px 12px; }
.more button, .empty button, .song-act, .song-back { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--rule-2); background: #fff; font-weight: 700; font-size: 16px; }
.more button:hover, .empty button:hover { background: var(--bg-2); }
.empty { padding: 24px 16px; }
.empty p { margin: 0 0 12px; font-size: 16px; }
.count, .empty p { overflow-wrap: anywhere; }
@media (max-width: 360px) { .seg button { padding: 0 6px; font-size: 15px } .yearnav select { min-width: 76px } .bar-row + .bar-row .seg { flex: none } }
.empty .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.loading { padding: 16px 12px; color: var(--ink-2); font-size: 14px; }

.src { margin: 8px 12px 32px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.src p { margin: 0 0 6px; }
.src a { color: var(--accent); }

/* ---- 曲の頁 ---- */
.song-col { background: #fff; }
.song-body { padding: 16px 16px 40px; }
.song-hint { margin: 32px 8px; color: var(--ink-2); font-size: 16px; }
.song-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.song-back { display: inline-flex; align-items: center; gap: 4px; padding-left: 10px; }
.song-meta { margin: 0; font-size: 14px; color: var(--ink-2); font-weight: 700; }
.song-title { margin: 4px 0 0; font-size: 26px; line-height: 1.3; font-weight: 900; overflow-wrap: anywhere; }
.song-title:focus { outline: none; }
.song-title:focus-visible { outline: 3px solid var(--focus); }
.song-artist { margin: 4px 0 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.song-en { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.song-listen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; }
.song-listen a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 24px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 800; font-size: 16px; }
.song-listen a:hover { background: #8e2c16; }
.song-listen small { font-size: 14px; color: var(--ink-2); }
.song-listen a.song-mix { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.song-listen a.song-mix:hover { background: rgba(0, 0, 0, 0.05); }
.facts { margin: 20px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.facts > div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.facts dd { margin: 0; font-size: 16px; }
.facts > .rel-wait dt, .facts > .rel-wait dd { visibility: hidden; } /* 作家・ジャンルを読む間の場所（archive-song.js） */
.facts dd ul { margin: 0; padding: 0; list-style: none; }
.facts dd li + li { margin-top: 2px; }
.rel-h { margin: 28px 0 4px; font-size: 16px; font-weight: 800; }
.rel-g { margin: 14px 0 0; }
.rel-g h4 { margin: 0 0 2px; font-size: 14px; color: var(--ink-2); font-weight: 700; }
.rel-g .rows { padding: 0; border-top: 1px solid var(--rule); }
.rel-g .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t s" "a s"; padding-left: 4px; padding-right: 4px; }
/* 曲名の左の ▶（試聴）: 行のリンクとは別の的（44px）。行の中の曲名の左に、曲名を --pl だけ右へ寄せて置く */
.rows li.p { position: relative; --pl: calc(24px + 2.2em); }
.rows li.p .c-title, .rel-g li.p .c-artist, .v-year li.p .c-artist, .v-week li.p .c-artist, .v-search li.p .c-artist { margin-left: 40px; }
.v-year li.p { --pl: 12px; } .v-week li.p { --pl: calc(24px + 5.6em); } .v-search li.p { --pl: calc(24px + 3.2em); } .rel-g li.p { --pl: 0px; }
.play { position: absolute; z-index: 1; left: calc(var(--pl) - 4px); top: 50%; width: 44px; height: 44px; margin-top: -22px; display: grid; place-items: center; padding: 0 0 0 2px; border: 0; border-radius: 50%; background: transparent; color: var(--accent); font-size: 16px; line-height: 1; cursor: pointer; }
.play span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid currentColor; }
.play:hover span, .play.on span { background: var(--accent); color: #fff; border-color: var(--accent); }
.play[aria-busy="true"] span { opacity: 0.45; }
.play[aria-disabled="true"] { color: #b9afa2; cursor: not-allowed; }
.play[aria-disabled="true"]:hover span { background: transparent; color: #b9afa2; border-color: currentColor; }
#colhead .h-ta, #colhead .h-t { margin-left: 40px; } /* 曲名の左の ▶ の分 */
.song-tline { display: flex; align-items: center; gap: 4px; margin: 4px 0 0 -8px; }
.song-tline .song-title { margin: 0; min-width: 0; }
.song-tline .play { position: static; flex: none; margin: 0; }
.song-tline .play span { width: 36px; height: 36px; font-size: 16px; }
.rel-g .none { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.song-src { margin: 24px 0 0; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.song-src p { margin: 0; }
.song-src a { color: var(--accent); }
.rel-more { margin-top: 6px; min-height: 44px; border: 0; background: transparent; color: var(--accent); font-weight: 700; padding: 0 4px; }

/* スマホ: 曲の頁は一覧の上に重ねる（戻るで一覧の同じ位置へ） */
@media (max-width: 959px) {
  .song-col { position: fixed; inset: 0; z-index: 20; overflow-y: auto; overscroll-behavior: contain; }
  body:not(.song-open) .song-col { display: none; }
  body.song-open { overflow: hidden; }
  .song-close { display: none; }
  .song-top { position: sticky; top: 0; z-index: 1; margin: -16px -16px 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--rule); }
}

/* 少し広い画面: 曲名と名前を横に並べた 1 行 */
@media (min-width: 600px) {
  .bar-in { flex-direction: row; flex-wrap: wrap; }
  .bar-row { flex: 1 1 auto; }
  .v-year .row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 7.5em; grid-template-areas: "t a s"; }
  .v-week .row { grid-template-columns: 7.5em minmax(0, 1.2fr) minmax(0, 1fr) 4.5em; grid-template-areas: "d t a s"; }
  .v-search .row { grid-template-columns: 3.4em minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 12em); grid-template-areas: "n t a s"; }
  .v-search .c-side { text-align: right; }
  .v-search li.p .c-side { margin-left: 0; }
  .v-search .row.head .c-side { display: block; }
  .c-artist { font-size: 14px; }
  .v-year li.p .c-artist, .v-week li.p .c-artist, .v-search li.p .c-artist { margin-left: 0; }
  .v-year li.p { --pl: 12px; } .v-week li.p { --pl: calc(24px + 7.5em); } .v-search li.p { --pl: calc(24px + 3.4em); }
  .row.head .h-ta { display: none; }
  .row.head .h-t, .row.head .h-a { display: block; }
}

/* PC: 左に一覧・右に曲の頁 */
@media (min-width: 960px) {
  .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 34%); align-items: start; }
  .song-col { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-left: 1px solid var(--rule-2); }
  .song-back { display: none; }
  .band { padding-left: 20px; padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .seg button[aria-pressed="true"] { outline: 2px solid CanvasText; }
}
.src-note { margin: -26px 12px 32px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.src-note:empty { display: none; }
.src-note p { margin: 0; }
