/* 賛美のしおり
   主役は礼拝堂の「讃美歌番号板」の札。まわりは静かに、札だけが明朝の大きな数字で立つ。 */

:root {
  --bg: #e9eeec;
  --surface: #f9fbfa;
  --surface-2: #eef3f1;
  --line: #cfdad7;
  --text: #15272a;
  --muted: #55696b;
  --main: #1f5559;
  --main-ink: #ffffff;
  --accent: #a8324a;
  --gold: #8f6f2e;
  --fuda: #f4ecd6;
  --fuda-ink: #1d1a15;
  --fuda-line: #d6c9a6;
  --board: #261d17;
  --board-line: #3d3027;
  --board-ink: #efe6cf;
  --board-muted: #b3a58a;
  --b21: #2f6f73;
  --b1: #6b2737;
  --b2: #7a5a2e;
  --bk: #86650f;
  --bk0: #5d6a2c;
  --focus: #1f5559;
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --gothic: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", "Meiryo", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e191b;
    --surface: #152326;
    --surface-2: #1b2c2f;
    --line: #2b4044;
    --text: #e2ebe8;
    --muted: #94a9a8;
    --main: #7fbdb9;
    --main-ink: #0c1a1c;
    --accent: #e58a9c;
    --gold: #cfae6b;
    --fuda: #e4dac0;
    --fuda-ink: #1d1a15;
    --fuda-line: #b9ac8a;
    --board: #1c1511;
    --board-line: #3a2e26;
    --focus: #9fd3cf;
  }
}
:root[data-theme="dark"] {
  --bg: #0e191b;
  --surface: #152326;
  --surface-2: #1b2c2f;
  --line: #2b4044;
  --text: #e2ebe8;
  --muted: #94a9a8;
  --main: #7fbdb9;
  --main-ink: #0c1a1c;
  --accent: #e58a9c;
  --gold: #cfae6b;
  --fuda: #e4dac0;
  --fuda-ink: #1d1a15;
  --fuda-line: #b9ac8a;
  --board: #1c1511;
  --board-line: #3a2e26;
  --focus: #9fd3cf;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--gothic);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 枠組み ---------- */

.app { min-height: 100vh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { margin: 0; font-family: var(--mincho); font-size: 1.07rem; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.tabs { margin-left: auto; display: flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.tab { border: 0; background: none; padding: 3px 11px; border-radius: 999px; font-size: 0.83rem; color: var(--muted); white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--main); color: var(--main-ink); }
.tab-count { margin-left: 5px; font-family: var(--mincho); font-weight: 700; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 1px solid transparent; border-radius: 50%; background: none; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* 狭いパネルでは、切り替えを題の下の段にして、はみ出さないようにする */
@media (max-width: 520px) {
  .top { flex-wrap: wrap; row-gap: 6px; }
  .top .icon-btn { margin-left: auto; }
  .tabs { order: 3; width: 100%; margin-left: 0; }
  .tab { flex: 1; padding: 4px 6px; }
}

.cols { flex: 1; display: block; }

/* 書体: 設定で「ゴシック」のときは、題や番号もゴシックにする */
:root[data-font="gothic"] { --mincho: var(--gothic); }

/* お気に入りの星 */
.card-acts { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fav {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 1px solid transparent; border-radius: 50%; background: none; color: var(--muted);
}
.fav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.fav:hover { background: var(--surface-2); color: var(--text); }
.fav[aria-pressed="true"] { color: var(--main); }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.ccard-head { display: flex; align-items: flex-start; gap: 8px; }
.ccard-head .card-title { flex: 1; min-width: 0; }
.ccard-head .fav { margin: -4px -4px 0 0; }
.fav-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.same-links { margin-top: 8px; }
.notes { margin-top: 8px; font-size: 0.84rem; }
.notes summary { cursor: pointer; color: var(--muted); }
.notes h4 { margin: 10px 0 2px; font-size: 0.86rem; }
.notes h4 small { margin-left: 8px; font-weight: 400; color: var(--muted); }
.notes ul { margin: 0; padding-left: 1.2em; }

/* 聖書箇所からさがす */
.ref-pick { display: grid; grid-template-columns: minmax(0, 1fr) 4.6em 4.6em auto; gap: 6px; align-items: center; }
.ref-pick .field { min-width: 0; width: 100%; }
.hint { margin: 6px 0 0; font-size: 0.76rem; color: var(--muted); }
@media (max-width: 380px) {
  .ref-pick { grid-template-columns: 1fr 1fr; }
  .ref-pick select { grid-column: 1 / -1; }
  .ref-pick .btn { grid-column: 1 / -1; }
}
.find, .plan { padding: 12px; }
.find, .organ { min-width: 0; }
.organ { padding: 12px; }
.app[data-tab="find"] .plan, .app[data-tab="find"] .organ { display: none; }
.app[data-tab="organ"] .plan, .app[data-tab="organ"] .find { display: none; }
.app[data-tab="plan"] .find, .app[data-tab="plan"] .organ { display: none; }

@media (min-width: 860px) {
  .tab[data-tab="plan"] { display: none; }
  .app[data-left="find"] .tab[data-tab="find"], .app[data-left="organ"] .tab[data-tab="organ"] { background: var(--main); color: var(--main-ink); }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 8px; max-width: 1180px; margin: 0 auto; width: 100%; }
  .app[data-tab] .plan { display: block; }
  .app[data-left="find"] .find, .app[data-left="organ"] .organ { display: block; }
  .app[data-left="find"] .organ, .app[data-left="organ"] .find { display: none; }
  .organ { padding: 16px 20px; }
  .plan { position: sticky; top: 47px; align-self: start; max-height: calc(100vh - 47px); overflow: auto; }
  .find { padding: 16px 20px; }
}

/* ---------- 入力 ---------- */

.ask { position: relative; }
#q {
  display: block; width: 100%; resize: none; overflow: hidden auto;
  min-height: 44px; max-height: 13em;
  padding: 10px 40px 10px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  line-height: 1.55;
}
#q::placeholder { color: var(--muted); }
#q:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.ask-clear { position: absolute; right: 6px; top: 7px; }
#oq {
  display: block; width: 100%; min-height: 44px; padding: 10px 40px 10px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; line-height: 1.55;
}
#oq::placeholder { color: var(--muted); }
#oq:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }

.books { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 4px; }
.book-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px 2px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.8rem; color: var(--text);
}
.book-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.book-chip[aria-pressed="false"] { color: var(--muted); background: transparent; text-decoration: line-through; }
.book-chip[aria-pressed="false"] .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }

[data-b="21"] { --c: var(--b21); }
[data-b="1"] { --c: var(--b1); }
[data-b="2"] { --c: var(--b2); }
[data-b="kodomo"] { --c: var(--bk); }
[data-b="kodomo0"] { --c: var(--bk0); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .book-chip[data-b="21"] { --c: #62aeb1; }
  :root:not([data-theme="light"]) .book-chip[data-b="1"] { --c: #c96b82; }
  :root:not([data-theme="light"]) .book-chip[data-b="2"] { --c: #c39a5c; }
  :root:not([data-theme="light"]) .book-chip[data-b="kodomo"] { --c: #d7b33f; }
  :root:not([data-theme="light"]) .book-chip[data-b="kodomo0"] { --c: #a9b765; }
}
:root[data-theme="dark"] .book-chip[data-b="21"] { --c: #62aeb1; }
:root[data-theme="dark"] .book-chip[data-b="1"] { --c: #c96b82; }
:root[data-theme="dark"] .book-chip[data-b="2"] { --c: #c39a5c; }
:root[data-theme="dark"] .book-chip[data-b="kodomo"] { --c: #d7b33f; }
:root[data-theme="dark"] .book-chip[data-b="kodomo0"] { --c: #a9b765; }

/* ---------- 札 ---------- */

.fuda {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 62px; min-height: 62px; flex: none; padding: 4px 2px 5px;
  background: var(--fuda); color: var(--fuda-ink);
  border: 1px solid var(--fuda-line); border-radius: 3px;
  text-align: center; text-decoration: none; align-self: start;
}
.fuda-book { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; color: var(--c); line-height: 1.3; }
.fuda-num { font-family: var(--mincho); font-weight: 700; font-size: 1.75rem; line-height: 1.1; letter-spacing: 0.01em; font-feature-settings: "tnum"; }
.fuda-num.long { font-size: 1.28rem; padding: 4px 0; }

/* ---------- 結果 ---------- */

.heading { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 14px 2px 8px; }
.heading h2 { margin: 0; font-family: var(--mincho); font-size: 1.12rem; font-weight: 600; }
.heading .count { color: var(--muted); font-size: 0.82rem; }
.heading .right { margin-left: auto; }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.active-filter {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 11px;
  background: var(--main); color: var(--main-ink); border: 0; border-radius: 999px; font-size: 0.82rem;
}
.active-filter svg { width: 14px; height: 14px; }

.clues { margin: 0 2px 10px; font-size: 0.82rem; color: var(--muted); }
.clues b { font-weight: 600; color: var(--text); }

.group { margin: 16px 2px 6px; font-family: var(--mincho); font-size: 0.95rem; color: var(--muted); }

.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px;
  padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.card-body { min-width: 0; }
.card-title { margin: 0; font-family: var(--mincho); font-size: 1.07rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.card-yomi { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }
.card-sum { margin: 3px 0 0; font-size: 0.87rem; }
.card-why { margin: 4px 0 0; font-size: 0.78rem; color: var(--muted); }
.strength { color: var(--accent); font-weight: 700; margin-right: 6px; }
.ai-why { margin: 4px 0 0; font-size: 0.8rem; color: var(--gold); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 5px; margin-top: 6px; align-items: center; }
.ref, .chip, .same {
  display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 0.76rem; line-height: 1.75;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-decoration: none;
}
.ref { font-family: var(--mincho); font-weight: 600; background: transparent; }
a.ref:hover, .chip:hover, .same:hover { border-color: var(--main); color: var(--main); }
.guess { font-size: 0.72rem; color: var(--muted); border: 1px dashed var(--muted); border-radius: 999px; padding: 0 7px; line-height: 1.7; }
.sung { font-size: 0.74rem; color: var(--gold); }
.same-label { font-size: 0.74rem; color: var(--muted); }

.add {
  display: inline-grid; place-items: center; width: 34px; height: 34px; align-self: start;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--main);
}
.add:hover { border-color: var(--main); }
.add[aria-pressed="true"] { background: var(--main); border-color: var(--main); color: var(--main-ink); }

.more-detail { grid-column: 1 / -1; margin: 0; }
.more-detail > summary { cursor: pointer; font-size: 0.78rem; color: var(--muted); width: fit-content; }
.more-detail[open] > summary { margin-bottom: 6px; }
.detail-row { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 5px 0; font-size: 0.8rem; }
.detail-row .label { color: var(--muted); font-size: 0.74rem; min-width: 3.4em; }
.note {
  display: block; width: 100%; min-height: 2.6em; margin-top: 6px; padding: 6px 9px; resize: vertical;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; font-size: 0.84rem;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.84rem;
}
.btn:hover { border-color: var(--main); color: var(--main); }
a.btn { color: inherit; text-decoration: none; }
.btn.primary { background: var(--main); border-color: var(--main); color: var(--main-ink); }
.btn.primary:hover { color: var(--main-ink); filter: brightness(1.08); }
.btn.quiet { border-color: transparent; background: none; color: var(--muted); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.center { display: flex; justify-content: center; margin: 12px 0; }

.empty { margin: 26px 4px; color: var(--muted); font-size: 0.9rem; }
.empty strong { display: block; color: var(--text); font-family: var(--mincho); font-size: 1.02rem; margin-bottom: 4px; }

/* ---------- ホーム ---------- */

.sunday {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  margin: 12px 0 4px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.sunday-date { font-size: 0.8rem; color: var(--muted); }
.sunday-name { margin: 0; font-family: var(--mincho); font-size: 1.3rem; font-weight: 600; line-height: 1.35; }
.sunday-sub { font-size: 0.78rem; color: var(--muted); }
.sunday-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.section { margin: 20px 2px 0; }
.section h2 { margin: 0 0 7px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { font-size: 0.82rem; padding: 1px 10px; }
.chips .chip small { color: var(--muted); margin-left: 5px; font-size: 0.72rem; }
.chips.books-of-bible .chip { font-family: var(--mincho); font-weight: 600; }
.try { display: flex; flex-wrap: wrap; gap: 6px; }
.try .chip { font-family: var(--mincho); }
.testament { font-size: 0.74rem; color: var(--muted); margin: 8px 0 5px; }
.about { margin: 24px 2px 8px; font-size: 0.76rem; color: var(--muted); }

/* ---------- オルガン（教会暦とコラール） ---------- */

.organ-seg { margin: 10px 0 2px; }
.seg.small button { padding: 1px 10px; font-size: 0.76rem; }
.year-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; margin: 10px 0 4px; }
.year-bar h2 { margin: 0 2px; font-family: var(--mincho); font-size: 1.2rem; font-weight: 600; font-feature-settings: "tnum"; }
.year-bar .seg { margin-left: auto; }

.cal-month { margin: 14px 2px 5px; font-family: var(--mincho); font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.cal { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.cal-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center;
  width: 100%; padding: 6px 10px 6px 6px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.cal-row:hover { border-color: var(--main); }
.cal-row.past { background: transparent; }
.cal-row.past .cal-name, .cal-row.past .day-fuda { opacity: 0.62; }
.cal-row.next { border-color: var(--main); box-shadow: 0 0 0 1px var(--main); }
.day-fuda { width: 50px; min-height: 50px; padding: 3px 2px 4px; align-self: center; }
.day-fuda .fuda-book { color: var(--fuda-ink); font-weight: 600; opacity: 0.75; }
.day-fuda .fuda-num { font-size: 1.42rem; line-height: 1.05; }
.fuda-dow { font-size: 0.64rem; line-height: 1.2; opacity: 0.75; }
.day-fuda.weekday { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.day-fuda.weekday .fuda-book { color: var(--text); }
.cal-body { display: grid; min-width: 0; }
.cal-name { font-family: var(--mincho); font-size: 1.02rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.cal-sub { font-size: 0.76rem; color: var(--muted); line-height: 1.45; }
.cal-next { margin-left: 8px; padding: 0 7px; border-radius: 999px; background: var(--main); color: var(--main-ink); font-family: var(--gothic); font-size: 0.68rem; font-weight: 600; vertical-align: 2px; }
.cal-count { font-size: 0.74rem; color: var(--muted); white-space: nowrap; }

.sunday > .icon-btn { align-self: start; }
.cat-chips { margin: 10px 0 0; }
.chip[aria-pressed="true"] { background: var(--main); border-color: var(--main); color: var(--main-ink); }
.chip[aria-pressed="true"] small { color: inherit; opacity: 0.8; }
.same small { margin-left: 5px; color: var(--muted); font-size: 0.7rem; }

.ccard { padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.ccard-de { font-family: var(--mincho); font-size: 0.9rem; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.hymn-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 9px; }
.hymn-links-label { flex-basis: 100%; font-size: 0.74rem; color: var(--muted); }
.hfuda {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 3px 11px 3px 3px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
}
.hfuda:hover { border-color: var(--main); }
.fuda.mini { width: 44px; min-height: 40px; padding: 2px 1px 3px; align-self: center; }
.fuda.mini .fuda-book { font-size: 0.58rem; }
.fuda.mini .fuda-num { font-size: 1.16rem; }
.fuda.mini .fuda-num.long { font-size: 0.92rem; padding: 2px 0; }
.hfuda-title { font-family: var(--mincho); font-size: 0.9rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }

.works { margin: 9px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.work { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 0 5px 6px; border-bottom: 1px solid var(--line); }
.work.hit { background: var(--surface-2); }
.work-main { display: grid; min-width: 0; }
.work-c { font-size: 0.84rem; font-weight: 600; line-height: 1.4; }
.work-t { font-size: 0.76rem; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.work-t small { margin-left: 6px; font-size: inherit; }
.work-no { font-family: var(--mincho); font-weight: 700; font-size: 0.96rem; white-space: nowrap; font-feature-settings: "tnum"; }
.add.small { width: 28px; height: 28px; align-self: center; }
.add.small svg { width: 15px; height: 15px; }
.works-more > summary { cursor: pointer; margin-top: 6px; font-size: 0.78rem; color: var(--muted); width: fit-content; }
.works-more .works { margin-top: 6px; }

.organ-fuda .fuda-book { color: var(--gold); font-size: 0.62rem; }
.fuda-num.xlong { font-size: 0.92rem; padding: 7px 0; }
.board-row .organ-fuda .fuda-num.long { font-size: 1.2rem; }
.board-row .organ-fuda .fuda-num.xlong { font-size: 0.9rem; }
.board-work { font-size: 0.74rem; color: var(--board-muted); line-height: 1.4; overflow-wrap: anywhere; }

/* ---------- 礼拝の選曲（番号板） ---------- */

.plan-head { display: grid; gap: 6px; margin-bottom: 10px; }
.plan-head h2 { margin: 0; font-family: var(--mincho); font-size: 1.07rem; font-weight: 600; }
.field-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
.field {
  width: 100%; padding: 5px 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 0.86rem;
}

.board {
  background: var(--board); color: var(--board-ink);
  border: 1px solid var(--board-line); border-radius: 6px;
  padding: 10px;
}
.board-title { margin: 0 0 8px; text-align: center; font-family: var(--mincho); font-size: 0.82rem; letter-spacing: 0.5em; text-indent: 0.5em; color: var(--board-muted); }
.board-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.board-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.board-row .fuda { width: 66px; min-height: 54px; border-color: transparent; align-self: center; }
.board-row .fuda-num { font-size: 1.7rem; }
.board-info { min-width: 0; }
.board-name { font-family: var(--mincho); font-size: 0.96rem; line-height: 1.4; overflow-wrap: anywhere; }
.role {
  max-width: 100%; margin-top: 2px; padding: 0 4px 0 0; border: 0; background: transparent;
  color: var(--board-muted); font-size: 0.76rem;
}
.role option { color: #1d1a15; background: #f4ecd6; }
.board-acts { display: flex; gap: 0; }
.board-acts .icon-btn { width: 26px; height: 26px; color: var(--board-muted); }
.board-acts .icon-btn:hover { background: rgba(255, 255, 255, 0.09); color: var(--board-ink); }
.board-acts .icon-btn[disabled] { opacity: 0.25; cursor: default; }
.board-acts svg { width: 15px; height: 15px; }
.board-empty { margin: 14px 6px; text-align: center; font-size: 0.84rem; color: var(--board-muted); }

.plan-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.history { margin-top: 22px; }
.history h3 { margin: 0 0 6px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.hist { padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.hist-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 0.84rem; }
.hist-head b { font-family: var(--mincho); font-weight: 600; }
.hist-songs { margin: 3px 0 5px; font-size: 0.8rem; color: var(--muted); }
.hist-acts { display: flex; gap: 4px; }
.hist-acts .btn { padding: 2px 10px; font-size: 0.76rem; }

/* ---------- 設定 ---------- */

.sheet {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
}
.sheet::backdrop { background: rgba(8, 16, 18, 0.55); }
.sheet h2 { margin: 0; font-family: var(--mincho); font-size: 1.1rem; font-weight: 600; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet h3 { margin: 16px 0 6px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.seg button { border: 0; background: none; padding: 3px 12px; border-radius: 999px; font-size: 0.83rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--main); color: var(--main-ink); }
.sheet p { margin: 6px 0; font-size: 0.82rem; color: var(--muted); }
.sheet .row { display: flex; flex-wrap: wrap; gap: 6px; }
.stats { margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.82rem; }
.stats li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--line); }
.stats li:last-child { border-bottom: 0; }

.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 20;
  max-width: calc(100vw - 32px); padding: 7px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 0.84rem;
}

@media (prefers-reduced-motion: no-preference) {
  .add, .btn, .chip, .tab, .cal-row, .hfuda { transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
}
