/* 今日のネタ帳 — iPad 横・縦、PC で読む前提。画像を活かした密度の高い一覧 */
:root {
  --bg: #f4f2ec;
  --paper: #ffffff;
  --ink: #1f1d1a;
  --muted: #6b665e;
  --line: #e2ddd2;
  --accent: #b9432b;
  --accent-soft: #f6e4df;
  --new: #ffd54a;
  --removed: #8a8580;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(40,30,10,.06);
  --fs: 1;  /* 文字の大きさ（右上の切り替え。カテゴリ名の帯とカードだけに効く） */
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}
html[data-fs="s"] { --fs: .88; }
html[data-fs="l"] { --fs: 1.2; }
html[data-fs="xl"] { --fs: 1.45; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* 上部メニュー（#cat-…）で飛んだとき、固定ヘッダーの下に見出しが隠れないようにする。--top-h は JS が実測する */
html { scroll-padding-top: calc(var(--top-h, 170px) + 8px); }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
b { font-weight: 700; }

/* ---- ヘッダ */
.top { position: sticky; top: 0; z-index: 5; background: rgba(244,242,236,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 18px 8px; }
.brand { display: flex; align-items: center; gap: 12px; }
/* 取得元一覧を開くボタン：隣の切り替え（丸いピル）と違う「メニューを開く」形にする。
   一覧のアイコン＋件数＋「開く」矢印、少し濃い枠と影、押すと沈む */
.src-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .85em; font-weight: 700;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 8px; padding: 5px 8px 5px 10px;
  cursor: pointer; box-shadow: 0 2px 0 rgba(31,29,26,.18); transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.src-btn:hover { background: #f1ede4; box-shadow: 0 3px 0 rgba(31,29,26,.22); }
.src-btn:active { transform: translateY(2px); box-shadow: none; }
.src-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.src-btn .ico, .src-btn .chev { width: 16px; height: 16px; flex: none; }
.src-btn .chev { color: var(--muted); margin-left: 2px; }
.src-btn:hover .chev { color: var(--ink); transform: translateX(-2px); transition: transform .15s; }
.src-btn .count { background: var(--ink); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .9em; line-height: 1.5; }
.src-btn .warn { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .9em; font-weight: 700; }
/* 別ページへのボタン（自局入力など）：取得元一覧の左に同じ形で並べる。最初のものが右寄せの起点 */
.tool-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .85em; font-weight: 700;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 8px; padding: 5px 10px;
  box-shadow: 0 2px 0 rgba(31,29,26,.18); transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.tool-btn:hover { background: #f1ede4; box-shadow: 0 3px 0 rgba(31,29,26,.22); text-decoration: none; }
.tool-btn:active { transform: translateY(2px); box-shadow: none; }
.tool-btn .ico { width: 16px; height: 16px; flex: none; }
.tool-btn + .tool-btn, .tool-btn ~ .src-btn { margin-left: 0; }
.logo { font-weight: 800; letter-spacing: .04em; color: var(--accent); }
.station { color: var(--muted); font-size: .9em; }
.daynav { margin-top: 4px; }
.daynav h1 { font-size: 1.5em; margin: 0; font-weight: 800; letter-spacing: .01em; }
.daynav .wd { font-size: .7em; color: var(--muted); margin-left: 4px; }
/* 文字の大きさの切り替え（小・通常・大・最大） */
.fs-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); overflow: hidden; font-size: .85em; white-space: nowrap; }
.fs-toggle button { font: inherit; border: 0; background: none; color: var(--muted); padding: 5px 10px; cursor: pointer; }
.fs-toggle button + button { border-left: 1px solid var(--line); }
.fs-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 700; }
/* カテゴリの中の並び（新着順・開催日順・取得元順）。文字の大きさの切り替えと同じ形 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); overflow: hidden; font-size: .95em; white-space: nowrap; }
.seg button { font: inherit; border: 0; background: none; color: var(--muted); padding: 5px 11px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 700; cursor: default; }
.btn { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; font: inherit; font-size: .9em; cursor: pointer; }
.btn:disabled { opacity: .4; cursor: default; }
.stats { color: var(--muted); font-size: .9em; margin-top: 6px; display: flex; align-items: center; gap: 0 6px; flex-wrap: wrap; }
.stats .hl { color: var(--accent); }
.stats .muted-note { font-size: .9em; }
.crawl-status { color: var(--muted); margin-left: 6px; }
.crawl-status.sep::before { content: "・"; margin-right: 6px; }
.crawl-status:empty { display: none; }
.btn.toggle[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
/* 「新着表示」：新着でないカードと、新着が無いカテゴリ・館・「もっと見る」を隠す */
body.new-only .card:not(.new) { display: none; }
body.new-only .no-new { display: none; }
body.new-only .vgroup.removed, body.new-only .vgroup.upcoming, body.new-only details.current { display: none; }
body.wk-only .card:not(.wk) { display: none; }
body.wk-only .no-wk { display: none; }
body.wk-only .vgroup.removed, body.wk-only .vgroup.upcoming, body.wk-only details.current { display: none; }
/* カテゴリへのジャンプ：上の切り替え（白い丸ピル）と見分けが付くよう、カテゴリの帯と同じ濃い色の角形の札＋つまみ（⠿）。
   掴んでドラッグで並べ替え（.sortable のときだけつまみとつかむカーソル） */
.cats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.cats a { font-size: .85em; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: var(--ink); color: #fff; border: 1px solid var(--ink); white-space: nowrap;
  box-shadow: 0 1px 0 rgba(31,29,26,.25); }
.cats a:hover { background: #33302b; text-decoration: none; }
.cats a b { margin-left: 6px; font-weight: 700; font-size: .85em; background: rgba(255,255,255,.18); color: #fff; border-radius: 4px; padding: 0 5px; }
.cats.sortable .cat-chip { padding-left: 5px; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; touch-action: none; }
.cats.sortable .cat-chip::before { content: "⠿"; margin-right: 4px; color: rgba(255,255,255,.5); font-weight: 400; }
.cats .cat-chip.dragging { cursor: grabbing; background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 16px rgba(0,0,0,.25); transform: scale(1.06); }
body.cat-dragging, body.cat-dragging * { cursor: grabbing !important; }
.cats-note { font-size: .75em; color: var(--muted); white-space: nowrap; margin-left: 4px; }
.cats-reset { font: inherit; font-size: .75em; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; white-space: nowrap; }
/* 「カテゴリー一覧」：初期は 1 つのボタンにたたむ（.closed）。開くと先頭に「閉じる」 */
.cats-open, .cats-close { font: inherit; font-size: .85em; font-weight: 700; cursor: pointer; white-space: nowrap; border-radius: 6px; padding: 4px 10px; }
.cats-open { color: #fff; background: var(--ink); border: 1px solid var(--ink); box-shadow: 0 1px 0 rgba(31,29,26,.25); display: inline-flex; align-items: center; gap: 6px; }
.cats-open b { font-size: .85em; background: rgba(255,255,255,.18); border-radius: 4px; padding: 0 5px; }
.cats-open .chev { font-size: .75em; opacity: .7; }
.cats-open:hover { background: #33302b; }
.cats-close { color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); }
.cats-close:hover { background: #f1ede4; }
.cats.closed > :not(.cats-open), .cats:not(.closed) > .cats-open { display: none; }
/* 上部の最小化：▲ボタン（日付の行の右端）で、最上部の細い帯（.top-restore）だけにする。帯を押すと戻る */
.top-min { margin-left: auto; align-self: center; font: inherit; font-size: .9em; font-weight: 800; color: #fff; background: var(--accent);
  border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 0 rgba(31,29,26,.2); }
.top-min span { font-size: 1.1em; margin-right: 2px; }
.top-min:hover { filter: brightness(1.08); }
.top-min:active { transform: translateY(2px); box-shadow: none; }
.top-restore { display: none; width: 100%; align-items: center; justify-content: center; gap: 10px; font: inherit; color: var(--ink);
  background: none; border: 0; padding: 4px 0; cursor: pointer; }
.top-restore .tr-arrow { color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 10px; font-size: .9em; }
.top-restore .tr-date { font-weight: 800; }
.top-restore .tr-lbl { color: var(--accent); font-weight: 700; font-size: .9em; }
.top-restore:hover .tr-lbl { text-decoration: underline; }
html[data-topmin] .top { padding: 4px 18px; }
html[data-topmin] .top > :not(.top-restore) { display: none; }
html[data-topmin] .top > .top-restore { display: flex; }

/* ---- カテゴリ */
main { padding: 14px 18px 40px; max-width: 1600px; margin: 0 auto; }
.empty { background: var(--paper); border: 1px dashed var(--line); padding: 20px; border-radius: var(--radius); color: var(--muted); }
details.cat { margin: 0 0 18px; }
details.cat > summary { font-size: calc(1rem * var(--fs)); list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--ink); color: #fff; border-radius: var(--radius); margin-bottom: 12px; }
details.cat > summary:hover { background: #33302b; }
details.cat > summary::-webkit-details-marker { display: none; }
details.cat > summary::before { content: "▾"; color: rgba(255,255,255,.6); width: 14px; }
details.cat:not([open]) > summary::before { content: "▸"; }
details.cat:not([open]) > summary { margin-bottom: 0; }
details.cat > summary h2 { font-size: 1.15em; margin: 0; }
details.cat > summary .count { color: rgba(255,255,255,.7); font-size: .9em; }
details.cat > summary .tag.scope { border-color: rgba(255,255,255,.5); color: #fff; background: transparent; }
.tag { display: inline-block; font-size: .72em; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--paper); vertical-align: middle; }
.tag.scope { border-color: var(--accent); color: var(--accent); }
.tag.new { background: var(--new); border-color: var(--new); color: #3a2f00; font-weight: 700; }
.tag.area { background: #eef3ee; border-color: #d5e2d5; color: #2f5d3a; }
.tag.ev { background: var(--removed); border-color: var(--removed); color: #fff; }

/* 取得元順：情報元ごとの小見出し */
.src-group { margin: 0 0 14px; }
.src-group-head { font-size: calc(.95rem * var(--fs)); margin: 0 0 6px; padding: 2px 2px 4px; display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--line); list-style: none; cursor: pointer; user-select: none; }
.src-group-head::-webkit-details-marker { display: none; }
.src-group-head::before { content: "▾"; color: var(--muted); width: 12px; }
details.src-group:not([open]) > .src-group-head::before { content: "▸"; }
details.src-group:not([open]) { margin-bottom: 6px; }
.src-group-head .src-link { font-size: .8em; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; background: var(--paper); }
.src-group-head .src-link:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.src-group-head .pub { font-weight: 800; color: var(--pc); }
.src-group-head .count { color: var(--muted); font-size: .85em; font-weight: 400; }

/* ---- カード */
/* 列の最小幅も文字の大きさに合わせて広げる（大きくすると 1 行のカード数が減る） */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(250px * var(--fs)), 1fr)); gap: 10px; }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(calc(320px * var(--fs)), 1fr)); }
.card { font-size: calc(1rem * var(--fs)); position: relative; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; min-height: calc(76px * var(--fs)); }
.card.has-img { grid-row: span 2; }
.card .img { display: block; aspect-ratio: 16 / 10; background: #eee; }
.card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 10px 12px 8px; flex: 1; }
.card h3 { font-size: .98em; margin: 0 0 4px; font-weight: 700; line-height: 1.35; padding-right: 4.2em; }
.card .sum { font-size: .82em; color: var(--muted); margin: 0 0 6px; line-height: 1.4; }
.card .meta { font-size: .78em; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
/* 日付：開催日が主（赤・太字・先頭）、掲載日・取得日は従（小さく薄く） */
.card .meta .evdate { font-weight: 700; color: var(--accent); font-size: 1.08em; }
.card .meta .date { color: var(--muted); font-weight: 400; font-size: .95em; }
.card .meta .pub { font-weight: 700; color: var(--pc); }
.card .meta .pub a { color: inherit; border-bottom: 1px solid color-mix(in srgb, var(--pc) 35%, transparent); }
/* 情報元の色（カテゴリ内で情報元ごとに違う色。白地で読める濃さ） */
.pub.pc-0 { --pc: #1f5fbf; } .pub.pc-1 { --pc: #1e7b3a; } .pub.pc-2 { --pc: #8a3fb5; }
.pub.pc-3 { --pc: #b55d00; } .pub.pc-4 { --pc: #00798c; } .pub.pc-5 { --pc: #c2185b; }
.pub.pc-6 { --pc: #5d6b00; } .pub.pc-7 { --pc: #6d4c41; } .pub.pc-8 { --pc: #283593; }
.pub.pc-9 { --pc: #b3261e; } .pub.pc-10 { --pc: #455a64; } .pub.pc-11 { --pc: #2e6b5e; }
.card.new { box-shadow: var(--shadow), inset 0 0 0 2px var(--new); }
/* 「削除された記事」：ページ末尾にまとめ、薄く出す */
details.deleted-group > summary { background: var(--removed); }
details.deleted-group > summary:hover { background: #75706b; }
.card.deleted { opacity: .6; box-shadow: var(--shadow); }
.card.deleted .img { filter: grayscale(1); }
.cats a.deleted-link { background: var(--removed); border-color: var(--removed); }
.card.ev-removed h3 { color: var(--removed); }
.ctl { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.del, .pick { font: inherit; font-size: .72em; color: var(--muted); background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px 2px 6px; display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.pick input { margin: 0; width: 15px; height: 15px; }
.del:hover { color: var(--accent); border-color: var(--accent); }
.card.deleted .del { color: var(--ink); border-color: var(--ink); }
.card.picked { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.card.picked .pick { color: #fff; background: var(--accent); border-color: var(--accent); }
.card h3 { padding-right: 7.5em; }
.card.has-img h3 { padding-right: 0; }  /* ボタンは画像の上に載る */
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.btn.primary b { background: rgba(255,255,255,.25); border-radius: 999px; padding: 0 7px; margin-left: 4px; }
dialog#draft-dialog { width: min(760px, 94vw); border: none; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 16px 18px; }
dialog#draft-dialog::backdrop { background: rgba(30,25,15,.45); }
.dlg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.dlg-head h2 { margin: 0; font-size: 1.1em; margin-right: auto; }
.dlg-head .muted { color: var(--muted); font-size: .8em; }
#draft-text { width: 100%; height: min(60vh, 520px); font: inherit; font-size: 1.05em; line-height: 1.7; padding: 12px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: .9em; padding: 6px 0; }
details.more[open] > summary { margin-bottom: 8px; }

/* ---- 映画館（venues） */
.venues { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; margin-bottom: 12px; }
.venue { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.venue h3 { margin: 0 0 8px; font-size: 1.05em; display: flex; align-items: baseline; gap: 10px; }
.venue h3 .count { margin-left: auto; font-size: .8em; color: var(--muted); font-weight: 400; }
.vgroup { margin: 8px 0; }
.vgroup h4 { margin: 0 0 6px; font-size: .85em; color: var(--accent); letter-spacing: .05em; }
.vgroup.removed h4 { color: var(--removed); }
.vgroup .grid { grid-template-columns: repeat(auto-fill, minmax(calc(150px * var(--fs)), 1fr)); }
.vgroup .card .img { aspect-ratio: 2 / 3; }
.vgroup .card h3 { font-size: .85em; padding-right: 0; }
.vgroup .card .del { display: none; }
.titles { margin: 0; padding: 0 0 0 1.1em; font-size: .9em; columns: 2; column-gap: 20px; }
.titles li { break-inside: avoid; margin: 1px 0; }
.titles .more { color: var(--muted); list-style: none; }
.upcoming .row { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; padding: 4px 0; border-top: 1px dashed var(--line); }
.upcoming .row .d { font-weight: 700; font-size: .9em; }
details.current > summary { cursor: pointer; font-size: .85em; color: var(--muted); padding: 6px 0; }
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 6px; }
.poster { display: block; font-size: .7em; line-height: 1.25; color: var(--muted); }
.poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 3px; background: #eee; }
.poster span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- 取得元の一覧（右のドロワー） */
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(520px, 94vw); height: 100vh; max-height: 100vh; border: none; border-left: 1px solid var(--line); background: var(--bg); box-shadow: -10px 0 40px rgba(0,0,0,.2); padding: 0; display: none; flex-direction: column; }
dialog.drawer[open] { display: flex; }
dialog.drawer::backdrop { background: rgba(30,25,15,.35); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); background: var(--paper); }
.drawer-head h2 { margin: 0; font-size: 1.1em; margin-right: auto; }
.drawer-head .muted, .drawer-note { color: var(--muted); font-size: .85em; }
.drawer-note { margin: 0; padding: 10px 18px; }
.warn-text { color: var(--accent); }
.src-list { list-style: none; margin: 0; padding: 0 18px; overflow-y: auto; flex: 1; }
.src-cat { position: sticky; top: 0; background: var(--bg); font-size: .8em; font-weight: 700; color: var(--muted); letter-spacing: .05em; padding: 12px 0 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.src { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.src .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: #3a9d5d; }
.src.st-error .dot { background: var(--accent); }
.src.st-stale .dot, .src.st-never .dot { background: #e0a400; }
.src.st-disabled .dot { background: #c9c4ba; }
.src.st-disabled .src-body { opacity: .55; }
.src-body { min-width: 0; flex: 1; }
.src-name { font-weight: 700; font-size: .95em; }
.src-status { font-weight: 400; font-size: .78em; color: var(--muted); margin-left: 8px; }
.src.st-error .src-status { color: var(--accent); font-weight: 700; }
.src.st-stale .src-status, .src.st-never .src-status { color: #a67a00; font-weight: 700; }
.src-url { display: block; font-size: .78em; color: #4a6fa5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-meta { font-size: .76em; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; }
.src.st-error .src-detail { color: var(--accent); }
.src-crawl { flex: none; align-self: center; font-size: .8em; padding: 6px 12px; }
.src.just-crawled { background: var(--accent-soft); }
.crawl-box { padding: 14px 18px 18px; border-top: 2px solid var(--accent); background: var(--accent-soft); }
.crawl-box h3 { margin: 0 0 6px; font-size: 1em; color: var(--accent); }
.crawl-box p { margin: 0 0 10px; font-size: .85em; color: var(--ink); }
.btn.danger { background: var(--accent); color: #fff; border: 2px solid #8d301d; font-weight: 700; padding: 10px 18px; font-size: .95em; box-shadow: 0 2px 0 #8d301d; }
.btn.danger:hover:not(:disabled) { background: #a33a25; text-decoration: none; }
.btn.danger:disabled { box-shadow: none; }
.crawl-box .crawl-status { display: block; margin: 8px 0 0; }
.crawl-box .crawl-status:empty { display: none; }

footer { color: var(--muted); font-size: .8em; text-align: center; padding: 20px; border-top: 1px solid var(--line); }
footer .foot-stats { margin-right: 6px; }
footer .foot-stats::after { content: "｜"; margin-left: 6px; }

@media (max-width: 700px) {
  /* ヘッダは固定しない（カテゴリが折り返して高くなるので、画面を占有しない） */
  .top { position: static; padding: 8px 12px 8px; }
  .brand { gap: 6px 8px; flex-wrap: wrap; }
  .fs-toggle { font-size: .8em; }
  .fs-toggle button { padding: 5px 8px; }
  .logo, .src-btn { white-space: nowrap; }
  .station { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8em; }
  .stats { font-size: .85em; gap: 4px 6px; }
  .stats .muted-note { display: none; }
  .cats a { font-size: .8em; padding: 4px 9px; }
  main { padding: 10px 12px 30px; }
  .daynav h1 { font-size: 1.2em; }
  .grid, .grid.compact { grid-template-columns: 1fr; }
  .venues { grid-template-columns: 1fr; }
  .titles { columns: 1; }
  /* カードは 1 列・画像は左に小さく。「選ぶ／削除」は下に回してタイトルの幅を空ける */
  .card { display: grid; grid-template-columns: 1fr; }
  .card.has-img { grid-row: auto; grid-template-columns: calc(108px * var(--fs)) 1fr; }
  .card.has-img .img { position: relative; aspect-ratio: auto; min-height: 96px; grid-row: span 2; }
  .card.has-img .img img { position: absolute; inset: 0; }  /* 縦長のポスターでもカードの高さに合わせて切る */
  .card h3, .card.has-img h3 { padding-right: 0; }
  .ctl { position: static; justify-content: flex-end; padding: 0 10px 8px; }
}
@media print {
  .top { position: static; }
  .del, .pick, .cats, .btn, .src-btn, .tool-btn, .fs-toggle, .crawl-status, .top-min, .top-restore, dialog { display: none !important; }
  details.cat > summary { background: none; color: var(--ink); border-bottom: 2px solid var(--ink); border-radius: 0; padding-left: 0; }
  details.cat, details.more, details.current { open: true; }
}

/* ---- ログイン */
.who { color: var(--muted); font-size: .85em; white-space: nowrap; }
.who a { color: var(--accent); }
.who .ro { background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 8px; margin-right: 6px; font-size: .9em; }
.who .me { color: var(--ink); font-weight: 700; margin-right: 6px; }
.who a + a { margin-left: 8px; }
.login select { font: inherit; font-weight: 400; font-size: 1.05em; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
/* ログインの設定（管理者） */
.acct { max-width: 760px; }
.acct-box { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin: 0 0 18px; }
.acct-box h2 { font-size: 1.1em; margin: 0 0 6px; }
.acct-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-items: end; margin-top: 12px; }
.acct-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85em; font-weight: 700; }
.acct-form input:not([type=checkbox]) { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
.acct-form .acct-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; grid-column: 1 / -1; }
.acct-form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.acct-form.inline input { flex: 1 1 200px; }
.acct-list { list-style: none; padding: 0; margin: 8px 0 0; }
.acct-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding: 4px 0 10px; }
.acct-list li .acct-form.inline:first-child { flex: 1 1 260px; }
.acct-list .empty { color: var(--muted); border: 0; }
.acct-msg { border-radius: 8px; padding: 8px 12px; font-weight: 700; font-size: .9em; }
.acct-msg.ok { background: #e3f1e5; color: #22613a; }
.acct-msg.err { background: var(--accent-soft); color: var(--accent); }
.acct-pick { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.acct-pick select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
.acct-list li .acct-form.inline { margin-top: 0; }
.qr-box { text-align: center; }
.qr-box svg { width: min(100%, 300px); height: auto; display: block; margin: 12px auto; }
.qr-box .qr-name { font-size: 1.4em; font-weight: 700; margin: 4px 0 0; }
@media print { .qr-page .top, .qr-page .acct-form, .qr-page .acct-msg, .qr-page footer { display: none !important; } .qr-page .acct-box { box-shadow: none; } }
.acct-list .btn.danger, .acct-auto .btn.danger { padding: 6px 12px; font-size: .9em; border-width: 1px; box-shadow: none; }
@media (max-width: 560px) { .acct-form { grid-template-columns: 1fr; } }
.login-body { min-height: 100vh; display: flex; flex-direction: column; }
.login-body footer { margin-top: auto; }
.login { width: 100%; max-width: 380px; margin: 12vh auto 40px; padding: 28px 24px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.login .logo { font-size: 1.6em; margin: 0 0 6px; }
.login-lead { color: var(--muted); font-size: .9em; margin: 0 0 18px; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: .9em; font-weight: 700; }
.login input { font: inherit; font-weight: 400; font-size: 1.05em; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.login input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.login .btn.primary { padding: 11px; font-size: 1em; margin-top: 4px; }
.login-error { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 8px 12px; font-size: .9em; font-weight: 700; margin: 0 0 14px; }
.login-note { color: var(--muted); font-size: .8em; margin: 18px 0 0; }
@media (max-width: 480px) { .login { margin: 6vh 16px 24px; width: auto; } }

/* ---- 気象庁など「種類ごとに最新だけ」のカード：更新時刻と種類を大きく出す */
.card.wx { border-left: 5px solid #1f5fbf; }
.card.wx .wx-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 6px; padding-right: 7.5em; line-height: 1.25; }
.card.wx .wx-head:hover { text-decoration: none; }
.card.wx .wx-time { font-size: 1.3em; font-weight: 800; color: #1f5fbf; }
.card.wx .wx-kind { font-size: 1.3em; font-weight: 800; }
.card.wx .sum { font-size: .88em; color: var(--ink); }
@media (max-width: 700px) { .card.wx .wx-head { padding-right: 0; } }

/* ---- 取得間隔の設定ページ */
.back-btn { margin-left: auto; font-size: .85em; padding: 5px 12px; }
.settings-note { color: var(--muted); font-size: .85em; margin: 6px 0 2px; max-width: 60em; }
.settings { padding: 8px 18px 30px; max-width: 1100px; margin: 0 auto; }
.set-cat { font-size: 1.05em; margin: 22px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.set-table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.set-table th { text-align: left; font-size: .78em; color: var(--muted); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.set-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.set-table tr:last-child td { border-bottom: 0; }
.set-table .c-every { width: 13em; }
.set-table .c-last { width: 8em; color: var(--muted); font-size: .85em; white-space: nowrap; }
.set-name { font-weight: 700; }
.set-link { display: inline-block; font-size: .75em; font-weight: 700; letter-spacing: .04em; color: #1f5fbf; }  /* URL は title に。表示は「LINK」だけ（長い URL で表がはみ出さないように） */
.set-off { font-size: .78em; color: var(--muted); }
/* 取得間隔の設定ページの末尾「表示の仕様」 */
.spec { margin-top: 36px; padding-top: 8px; border-top: 2px solid var(--line); }
.spec h2 { font-size: 1.2em; margin: 12px 0 4px; }
.spec h3 { font-size: 1em; margin: 20px 0 6px; color: var(--accent); }
.spec ul { margin: 0; padding-left: 1.3em; font-size: .9em; line-height: 1.7; }
.spec .spec-lead { font-size: .9em; font-weight: 700; margin: 12px 0 4px; }
.spec-table td { font-size: .85em; line-height: 1.6; }
.spec-table .set-name { white-space: nowrap; }
.spec-sub { color: var(--muted); font-size: .92em; }
.spec .spec-cell { margin: 0; padding-left: 1.1em; font-size: 1em; line-height: 1.6; }
.set-row.off td { opacity: .55; }
.every-select { font: inherit; font-size: .95em; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); min-width: 8em; }
.set-row.changed .every-select { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.set-state { font-size: .75em; color: var(--muted); margin-top: 3px; min-height: 1em; }
@media (max-width: 600px) {
  .settings { padding: 8px 12px 24px; }
  .set-table thead { display: none; }
  /* 表示の仕様の表は 1 カテゴリーずつ縦に並べ、見出し（thead は隠れる）を各欄の頭に出す */
  .set-table.spec-table tr { display: block; padding: 6px 0; }
  .set-table.spec-table td { display: block; padding: 3px 12px; }
  .set-table.spec-table td:not(.set-name)::before { content: attr(data-label) "："; color: var(--muted); font-weight: 700; }
  .set-table tr { display: grid; grid-template-columns: 1fr auto; }
  .set-table td { border-bottom: 0; }
  .set-table .c-name { grid-column: 1 / -1; padding-bottom: 2px; }
  .set-table .c-every, .set-table .c-last { width: auto; padding-top: 2px; }
  .set-table tr { border-bottom: 1px solid var(--line); }
}
/* 取得間隔の設定：上部の「1日、または2日間隔の場合の更新時刻」 */
.set-top { margin: 8px 0 4px; }
.set-daily { margin-top: 10px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; font-weight: 700; font-size: .92em; }
.set-daily .time-select { font: inherit; padding: 4px 8px; margin-left: 8px; border: 1px solid var(--accent); border-radius: 8px; background: var(--paper); color: var(--accent); font-weight: 700; }
.set-daily .set-state { font-weight: 400; }
.set-table .c-next { width: 8em; font-size: .85em; white-space: nowrap; }
.set-table .m-label { display: none; }
@media (max-width: 600px) {
  .set-table tr { grid-template-columns: 1fr auto auto; }
  .set-table .c-next { width: auto; padding-top: 2px; }
  .set-table .m-label { display: inline; color: var(--muted); }
}

/* ---- 検索トレンド（layout: trends）：順位つきの小さなランキング。記事カードより背を低くしてページ上部に置く */
details.cat > summary .trends-src { margin-left: auto; font-size: .78em; color: rgba(255,255,255,.75); }
details.cat > summary a.trends-src { border-bottom: 1px solid rgba(255,255,255,.35); }
.trends { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(260px * var(--fs)), 1fr)); gap: 10px; }
.trend { font-size: calc(1rem * var(--fs)); display: flex; align-items: flex-start; gap: 10px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; border-top: 3px solid var(--accent); min-width: 0; }
.trend.new { box-shadow: var(--shadow), inset 0 0 0 2px var(--new); }
.trend .rank { flex: none; font-size: 1.6em; font-weight: 800; line-height: 1; color: var(--accent); min-width: 1.1em; text-align: center; }
.trend-body { flex: 1; min-width: 0; }
.trend-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.trend .word { font-size: 1.15em; font-weight: 800; line-height: 1.25; }
.trend .traffic { font-size: .75em; font-weight: 700; color: var(--accent); white-space: nowrap; }
.trend-news { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .8em; color: var(--ink); margin-top: 4px; line-height: 1.35; }
.trend-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: .72em; color: var(--muted); margin-top: 4px; }
.trend-img { flex: none; width: calc(64px * var(--fs)); height: calc(64px * var(--fs)); object-fit: cover; border-radius: 6px; background: #eee; }
@media (max-width: 700px) {
  .trends { grid-template-columns: 1fr; }
  details.cat > summary .trends-src { display: none; }
}

/* ---- 祝日・記念日（メイン画面の日付の横の赤文字と、/<region>/calendar） */
:root { --holiday: #d32f2f; }
.daynav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.daymarks { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; color: var(--holiday); font-weight: 800; font-size: 1.15em; }
.daymarks:hover { text-decoration: none; opacity: .8; }
.daymarks .anniv-memo { font-size: .62em; font-weight: 700; margin-left: 5px; }
.daymarks .hday::before { content: "祝 "; font-size: .75em; }
.daymarks .anniv + .anniv::before, .daymarks .hday + .anniv::before { content: "・"; margin-left: -6px; color: var(--holiday); }

.cal-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.cal-nav h2 { font-size: 1.3em; margin: 0 6px; min-width: 7.5em; text-align: center; }
.cal-grid { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-grid th { font-size: .8em; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--line); }
.cal-grid th.sun, .cal-grid td.sun .cal-d, .cal-grid td.holiday .cal-d { color: var(--holiday); }
.cal-grid th.sat, .cal-grid td.sat .cal-d { color: #1f5fbf; }
.cal-grid td.holiday.sat .cal-d { color: var(--holiday); }
.cal-grid td { vertical-align: top; height: 92px; padding: 5px 6px; border: 1px solid var(--line); font-size: .78em; line-height: 1.3; overflow-wrap: anywhere; }
.cal-grid td.out { background: #faf9f5; }
.cal-grid td.out > * { opacity: .45; }
.cal-grid td.holiday { background: #fdf0ef; }
.cal-grid td.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-d { font-size: 1.25em; font-weight: 800; margin-bottom: 2px; }
.cal-today { font-size: .65em; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; margin-left: 4px; vertical-align: middle; }
.cal-h, .cal-a { color: var(--holiday); font-weight: 700; }
.cal-a { margin-top: 2px; padding-left: 6px; border-left: 3px solid var(--holiday); }
.cal-source { margin-top: 8px; }
.anniv-list { margin-top: 18px; }
.anniv-form-wrap { margin-top: 14px; }
.anniv-table .c-ops { width: 9em; white-space: nowrap; text-align: right; }
.anniv-today { color: var(--holiday); }
.btn.small { font-size: .8em; padding: 3px 10px; }
.del-btn:hover { color: var(--accent); border-color: var(--accent); }
.anniv-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.anniv-form label { display: flex; flex-direction: column; gap: 3px; font-size: .82em; font-weight: 700; color: var(--muted); }
.anniv-form label[hidden] { display: none; }
.anniv-form label small { font-weight: 400; }
.anniv-form input, .anniv-form select { font: inherit; font-size: 1.15em; font-weight: 400; color: var(--ink); padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.anniv-form .f-name { flex: 1 1 16em; }
.anniv-form .f-memo { flex: 1 1 100%; }
.anniv-form input[name="since_year"] { width: 7em; }
.anniv-form .f-ops { flex: 1 1 100%; display: flex; align-items: center; gap: 10px; }
@media (max-width: 700px) {
  .cal-nav { gap: 6px; }
  .cal-nav h2 { min-width: 0; font-size: 1.1em; margin: 0 2px; }
  .cal-nav .btn { padding: 5px 9px; }
  .cal-grid td { height: 64px; padding: 3px; font-size: .68em; }
  .cal-d { font-size: 1.15em; }
  .daymarks { font-size: 1em; }
}

/* ---- 今日は何の日（layout: onthisday）：記念日・誕生日・できごとの 3 列。上位だけ大きく、残りは折りたたみ */
.otd { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.otd-group { font-size: calc(1rem * var(--fs)); background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px 12px; border-top: 3px solid var(--accent); min-width: 0; }
.otd-group h3 { margin: 0 0 6px; font-size: .9em; color: var(--accent); letter-spacing: .05em; }
.otd-top { list-style: none; margin: 0; padding: 0; }
.fact { padding: 7px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact-title { display: block; font-size: 1.12em; font-weight: 800; line-height: 1.3; color: var(--ink); }
.otd-event .fact-title { font-size: 1em; font-weight: 700; }
.fact-meta { display: flex; flex-wrap: wrap; gap: 3px 6px; align-items: center; font-size: .78em; color: var(--muted); margin-top: 3px; }
.fact-sum { font-size: .82em; color: var(--muted); margin: 4px 0 0; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.otd-more { margin-top: 6px; font-size: .85em; }
.otd-more > summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.otd-more ul { margin: 6px 0 0; padding-left: 1.1em; line-height: 1.5; }
.otd-more li { margin-bottom: 4px; }
.fact-label { color: var(--muted); font-size: .9em; margin-left: 6px; }
.fact-more-sum { display: block; color: var(--muted); font-size: .88em; line-height: 1.35; }
.otd-more .tag { margin-left: 4px; }
.otd-note { font-size: .75em; color: var(--muted); margin: 6px 2px 0; }
@media (max-width: 900px) { .otd { grid-template-columns: 1fr; } }
/* 今日の運勢（12 個の文をそのまま。番号・改行は AI の出したまま） */
.fortune { font-size: calc(1rem * var(--fs)); background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; border-top: 3px solid var(--accent); white-space: pre-line; line-height: 1.6; }
.fortune-error { background: var(--paper); border-radius: var(--radius); padding: 10px 14px; border-left: 4px solid var(--accent); color: var(--accent); font-weight: 700; margin: 0; }

/* ---- 自局で入力した情報（カレンダーで登録。メイン画面ではカードに「自局入力」） */
:root { --manual: #1f6f5c; }
.tag.manual { background: var(--manual); border-color: var(--manual); color: #fff; font-weight: 700; }
.card.manual { box-shadow: var(--shadow), inset 3px 0 0 var(--manual); }
.card.manual.new { box-shadow: var(--shadow), inset 3px 0 0 var(--manual), inset 0 0 0 2px var(--new); }
a.del { text-decoration: none; }
.cal-sub { color: var(--muted); font-size: .85em; }
.cal-add { margin-left: auto; }
.cal-grid td[data-day] { cursor: pointer; }
.calendar-page .cal-grid td.holiday { cursor: pointer; }
button.cal-a, button.cal-e { display: block; width: 100%; text-align: left; font: inherit; line-height: 1.3; cursor: pointer; background: none; border: 0; padding: 0 0 0 6px; margin-top: 2px; }
button.cal-a { color: var(--holiday); font-weight: 700; border-left: 3px solid var(--holiday); }
.cal-e { color: #fff; background: var(--manual); border-radius: 4px; padding: 1px 5px; margin-top: 2px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.cal-e { background: var(--manual); padding: 1px 5px; border-radius: 4px; color: #fff; }
button.cal-a:hover, button.cal-e:hover { filter: brightness(1.15); }
.cal-e-g { font-size: .82em; opacity: .8; margin-right: 3px; }
.cal-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.cal-legend .cal-e, .cal-legend .cal-a, .cal-legend .cal-h { display: inline-block; width: auto; margin: 0; font-size: .9em; }
.cal-legend .cal-a { padding-left: 5px; border-left: 3px solid var(--holiday); color: var(--holiday); font-weight: 700; }
.entry-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.entry-list li + li { border-top: 1px solid var(--line); }
.entry-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; text-align: left; font: inherit; background: none; border: 0; padding: 9px 12px; cursor: pointer; color: var(--ink); }
.entry-row:hover { background: var(--accent-soft); }
.entry-span { color: var(--manual); font-weight: 700; white-space: nowrap; }
.anniv-form textarea { font: inherit; font-size: 1.05em; font-weight: 400; color: var(--ink); padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); resize: vertical; }
.f-photo { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.photo-preview { display: flex; align-items: flex-end; gap: 10px; }
.photo-preview[hidden] { display: none; }
.photo-preview img { max-width: 180px; max-height: 120px; border-radius: 6px; object-fit: cover; }
.anniv-form .photo-remove { flex-direction: row; align-items: center; gap: 4px; }
.cal-dialog { border: 0; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
.cal-dialog::backdrop { background: rgba(20,15,5,.45); }
.cal-dialog-body { padding: 16px 18px 6px; overflow-y: auto; }
.cal-dialog-body h3 { margin: 6px 0 4px; font-size: 1.2em; }
.cal-dialog .d-kind { display: flex; gap: 6px; }
.cal-dialog .d-when { color: var(--manual); font-weight: 700; }
.cal-dialog .d-img { display: block; max-width: 100%; max-height: 50vh; margin: 10px 0; border-radius: 8px; }
.cal-dialog .d-body { white-space: pre-wrap; line-height: 1.6; margin: 8px 0; }
.cal-dialog .d-meta { color: var(--muted); font-size: .8em; }
.cal-dialog-ops { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 18px 14px; border-top: 1px solid var(--line); }
@media (max-width: 700px) {
  .cal-add { margin-left: 0; }
  .cal-e-g { display: none; }
}

/* ---- 今日の暦（日付とカレンダーの間に短く） */
.koyomi { display: inline-flex; flex-wrap: wrap; gap: 0 10px; font-size: .82em; color: var(--muted); }
.koyomi b { color: var(--ink); font-weight: 700; }
.koyomi .moon-age { display: inline-flex; align-items: center; gap: 4px; }
.koyomi .moon { flex: none; }
.koyomi .moon-dark { fill: #3b3f4f; }
.koyomi .moon-lit { fill: #f6d76b; }

/* ---- 全国ランキング（/<region>/ranking） */
.rk-head { display: flex; align-items: baseline; gap: 10px; color: var(--accent); }
.rk-head.worst { color: #1f5fbf; }
.rk-head span { font-size: .75em; color: var(--muted); font-weight: 400; }
.rk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
/* 枠の色は順位で変える（トップ：1 位 金・2 位 銀・3 位 銅・4〜5 位 赤系／ワースト：最下位ほど濃い青） */
.rk-item { --rk: #c9c3b6; display: flex; gap: 12px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; border: 2px solid var(--rk); }
.rk-item.rk-1 { --rk: #d4a017; background: #fffaf0; }
.rk-item.rk-2 { --rk: #9aa3ad; }
.rk-item.rk-3 { --rk: #b87333; }
.rk-item.rk-4, .rk-item.rk-5 { --rk: #e2a89a; }
.rk-item.worst.rk-1 { --rk: #1f3f8f; background: #f3f6fc; }
.rk-item.worst.rk-2 { --rk: #3b63b8; }
.rk-item.worst.rk-3 { --rk: #6f8fd0; }
.rk-item.worst.rk-4, .rk-item.worst.rk-5 { --rk: #a9bde6; }
.rk-item .rk-badge { color: var(--rk); }
.rk-item.rk-4 .rk-badge, .rk-item.rk-5 .rk-badge { color: var(--accent); }
.rk-item.worst .rk-badge { color: #1f5fbf; }
.rk-toggle { margin: 10px 0 12px; font-size: 1em; }
.rk-toggle button { padding: 7px 16px; }
.rk-toggle button b { margin-left: 6px; font-size: .85em; opacity: .75; }
.rk-pane[hidden] { display: none; }
.rk-badge { flex: none; min-width: 3.2em; text-align: center; font-size: 1.6em; font-weight: 800; color: var(--accent); line-height: 1.1; }
.rk-badge small { font-size: .5em; margin-left: 1px; }
.rk-item.worst .rk-badge { font-size: 1em; padding-top: 4px; }
.rk-body { flex: 1; min-width: 0; }
.rk-body h3 { margin: 0 0 4px; font-size: 1.1em; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rk-measures { list-style: none; margin: 0; padding: 0; font-size: .85em; line-height: 1.7; }
.rk-measures li { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.rk-m { color: var(--muted); font-weight: 700; }
.rk-rank { font-weight: 800; }
.rk-rank.hi { color: var(--accent); }
.rk-rank.lo { color: #1f5fbf; }
.rk-ratio, .rk-top { color: var(--muted); font-size: .92em; }
.rk-say { margin: 6px 0 0; font-size: .85em; background: var(--bg); border-radius: 6px; padding: 6px 8px; line-height: 1.5; }
@media (max-width: 700px) { .rk-list { grid-template-columns: 1fr; } }
/* 全国ランキングのタブ（情報元ごと） */
.rk-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; border-bottom: 2px solid var(--ink); }
.rk-tabs a { padding: 7px 14px 6px; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 700; font-size: .92em; background: var(--paper); border: 1px solid var(--line); border-bottom: 0; }
.rk-tabs a:hover { color: var(--ink); text-decoration: none; }
.rk-tabs a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.rk-item.rk-mid { --rk: var(--line); }
.rk-item.rk-mid .rk-badge { color: var(--muted); }
.rk-note { margin: 4px 0 0; font-size: .75em; color: var(--muted); line-height: 1.45; }

/* ---------------------------------------------------------------- メイン画面の「カレンダー表示」
   マス（.cal-grid）は自局入力のページと共通。中のタイトルはカテゴリの色（cc-0〜9）。マスの高さは中身に合わせて伸びる */
body.cal-mode main > details.cat, body.cal-mode main > .empty { display: none; }
.cal-view { font-size: calc(1rem * var(--fs)); margin-bottom: 20px; }
.cal-view .cal-grid td { height: 96px; cursor: default; }
.cal-view .cal-legend { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 4px 0 8px; font-size: .85em; }
.cal-view .cal-legend .cal-i { width: auto; display: inline-block; margin: 0; padding: 2px 8px 2px 6px; border-radius: 0 4px 4px 0; }
.cal-cat[aria-pressed="false"] { opacity: .4; text-decoration: line-through; border-left-style: dashed; }
.cc-0 { --cc: #b9432b; } .cc-1 { --cc: #1f5fbf; } .cc-2 { --cc: #1e7b3a; } .cc-3 { --cc: #8a3fb5; } .cc-4 { --cc: #b55d00; }
.cc-5 { --cc: #00798c; } .cc-6 { --cc: #c2185b; } .cc-7 { --cc: #5d6b00; } .cc-8 { --cc: #6d4c41; } .cc-9 { --cc: #283593; }
.cal-i { display: block; width: 100%; text-align: left; font: inherit; line-height: 1.3; cursor: pointer; color: var(--cc); font-weight: 700;
  background: none; border: 0; border-left: 3px solid var(--cc); padding: 0 0 0 5px; margin-top: 3px; }
.cal-i:hover { background: color-mix(in srgb, var(--cc) 10%, transparent); }
.cal-i-g { font-size: .8em; font-weight: 700; color: #fff; background: var(--cc); border-radius: 3px; padding: 0 4px; margin-right: 4px; }
/* 帯（2〜6 日）：週ごとの最初のマスに 1 つだけ置き、幅は JS（sizeBands）が最後の日のマスまで伸ばす。1 行で切り、全文は吹き出しで */
.cal-band { position: relative; z-index: 1; color: #fff; background: var(--cc); border-left: 0; padding: 1px 6px; margin: 3px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 1.6em; }
.cal-band:hover { background: var(--cc); filter: brightness(1.12); }
.cal-band.b-s { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.cal-band.b-e { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.cal-band.cal-gap { visibility: hidden; }
.cal-view .cal-grid td.out .cal-items { opacity: .55; }
.cal-view .cal-grid td.out > * { opacity: 1; }
.cal-view .cal-grid td.out .cal-d, .cal-view .cal-grid td.out .cal-h, .cal-view .cal-grid td.out .cal-a { opacity: .45; }
.cal-balloon { position: fixed; z-index: 50; width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto;
  border-radius: var(--radius); box-shadow: 0 10px 34px rgba(0,0,0,.28); }
.cal-balloon .card { display: flex !important; box-shadow: none; }
.cal-balloon .card h3 { padding-right: 0; }
.acct-auto { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.acct-auto h3 { font-size: 1em; margin: 0 0 4px; }
.acct-auto #auto-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; }
