:root {
  --bg: #f4f4f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #8a8a8f;
  --line: #ececee;
  --accent: #1f6feb;
  --accent-dark: #1857c0;
  --danger: #d33;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }

/* ログイン画面 */
body.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card { max-width: 360px; width: 100%; margin: 0; }

/* トップバー */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}
.topbar .brand { font-size: 1.3rem; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right .user { color: var(--muted); }

.brand { color: var(--accent); font-weight: 800; letter-spacing: -0.02em; }
.brand-sub { color: var(--muted); margin-top: -8px; font-size: .9rem; }

.container { max-width: 720px; margin: 0 auto; padding: 16px; }

/* カード */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.quick-add { display: flex; gap: 8px; margin-bottom: 12px; }
.quick-add input { flex: 1; margin: 0; }
.quick-add .btn { white-space: nowrap; }
.add-card h2 { margin-top: 0; }

/* フォーム */
label { display: block; margin-bottom: 12px; color: var(--muted); font-size: .85rem; }
input, textarea {
  width: 100%; margin-top: 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
.row { display: flex; gap: 8px; }
.row.actions { align-items: center; margin-top: 4px; }

/* ボタン */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: .9rem;
  cursor: pointer;
  background: #eee;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { color: var(--danger); }
.btn.primary.btn-block { width: 100%; }
.btn.small { padding: 4px 10px; font-size: .8rem; }

/* OGP プレビュー */
.ogp-preview { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 12px; }
.ogp-preview.hidden { display: none; }
.og-img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; background: #eee; flex-shrink: 0; }
.og-text { min-width: 0; }
.og-site { font-size: .75rem; color: var(--muted); }
.og-title { font-weight: 700; font-size: .9rem; }
.og-desc { font-size: .8rem; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ツールバー */
.toolbar { margin-bottom: 16px; }
.search { display: flex; gap: 8px; margin-bottom: 10px; }
.search input { flex: 1; }

/* タグ */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block; padding: 2px 10px;
  border-radius: 999px; background: #eef3fb;
  color: var(--accent); font-size: .8rem;
}
.tag.active { background: var(--accent); color: #fff; }

/* ニュースカード */
.news-card { display: flex; gap: 14px; padding: 14px; }
.thumb { flex-shrink: 0; }
.thumb img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; background: #eee; display: block; }
.news-body { flex: 1; min-width: 0; }
.meta { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.news-title { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.4; }
.news-title a { color: var(--text); }
.news-title a:hover { color: var(--accent); }
.news-subs { margin: -2px 0 6px; }
.entry-detail { font-size: .72rem; color: var(--muted); text-decoration: none; }
.entry-detail:hover { color: var(--accent); text-decoration: underline; }

/* 記事ページ */
.entry { padding: 20px; }
.entry-img { width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; background: #eee; }
.entry-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.entry-meta time { margin-left: auto; }
.entry-title { font-size: 1.5rem; line-height: 1.4; margin: 10px 0; }
.entry-title a { color: var(--text); }
.entry-title a:hover { color: var(--accent); }
.entry-desc { font-size: .95rem; color: var(--muted); margin: 0 0 12px; }
.entry-comment h3 { font-size: .95rem; margin: 0 0 6px; color: var(--text); }
.entry-back { margin-top: 16px; text-align: center; }
.entry h2 { font-size: 1rem; margin-bottom: 10px; }

/* --- SNSシェアボタン --- */
.share { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 30px; padding: 0 10px;
  border: none; border-radius: 6px; cursor: pointer;
  color: #fff; font-size: .85rem; font-weight: 700; text-decoration: none;
}
.share-btn:hover { opacity: .85; }
.share-x    { background: #000; }
.share-fb   { background: #1877f2; }
.share-line { background: #06c755; }
.share-hatebu { background: #3c9dd1; }
.share-pocket { background: #ef3f56; }
.share-copy { background: #718096; }
.entry-share h2 { margin-bottom: 4px; }

/* ページネーション */
.pagination {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center;
  margin: 16px 0 4px;
}
.page-btn {
  min-width: 32px; padding: 6px 10px; text-align: center;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: var(--text); font-size: .85rem; text-decoration: none;
}
[data-theme="dark"] .page-btn { background: #2a2a2a; }
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.current { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.page-info { font-size: .78rem; color: var(--muted); margin-left: 6px; }

/* 関連記事 */
.related { list-style: none; margin: 0; padding: 0; }
.related li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.related li:last-child { border-bottom: none; }
.related img {
  width: 56px !important; height: 42px !important; max-width: 56px; max-height: 42px;
  object-fit: cover; flex-shrink: 0; border-radius: 6px; background: #eee;
}
.related li > div { min-width: 0; }
.related a { color: var(--text); }
.related a:hover { color: var(--accent); }
.related time { display: block; font-size: .72rem; color: var(--muted); }

/* バックアップ一覧 */
.btable { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: .85rem; }
.btable th, .btable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.btable th { font-size: .75rem; color: var(--muted); }
.btable-actions { white-space: nowrap; }
.btable-actions form { display: inline; margin: 0; }
.btable-actions .btn { margin-right: 4px; }
.alert.success { background: #eafaf0; color: #2e7d4f; }
.alert.warn { background: #fff6e6; color: #8a6d1a; border: 1px solid #f0dcae; }
.alert.warn a { color: var(--accent); text-decoration: underline; }

/* ログイン履歴 */
td.ok { color: #2e7d4f; font-weight: 700; }
td.fail { color: var(--danger); font-weight: 700; }
td.ua { font-size: .72rem; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- リアクション / 星 / 既読 / あとで --- */
.card-utils { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.react { display: flex; flex-wrap: wrap; gap: 6px; }
.rbtn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 3px 10px; font-size: .82rem; cursor: pointer; color: var(--text);
}
[data-theme="dark"] .rbtn { background: #2a2a2a; }
.rbtn:hover { border-color: var(--accent); }
.rbtn { color: var(--accent); }
.rcnt { font-size: .75rem; color: var(--muted); }
.ptools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.stars { display: inline-flex; gap: 1px; }
.star { border: none; background: none; cursor: pointer; font-size: 1rem; color: #c8c8c8; padding: 0 1px; }
.star.on { color: #f5b301; }
.ptool {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 3px 8px; font-size: .75rem; cursor: pointer; color: var(--muted);
}
[data-theme="dark"] .ptool { background: #2a2a2a; }
.ptool.on { color: #fff; background: var(--accent); border-color: var(--accent); }

/* --- コメントスレッド --- */
.cthread { margin: 10px 0 0; }
.comment {
  border-left: 3px solid var(--line); margin: 8px 0; padding: 6px 10px;
  background: var(--card); border-radius: 0 8px 8px 0;
}
.cc-head { display: flex; align-items: center; gap: 8px; font-size: .72rem; color: var(--muted); }
.cc-head .comment-author { font-weight: 700; color: var(--accent); }
.cc-head time { margin-right: auto; }
.comment-body { font-size: .88rem; margin-top: 4px; }
.comment-body img { max-width: 100%; border-radius: 6px; }
.cadd { margin-top: 8px; display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.cc-ta { flex: 1; min-width: 180px; }
.cadd .btn { white-space: nowrap; align-self: center; }

/* --- ダークモード --- */
[data-theme="dark"] {
  --bg: #121212; --card: #1c1c1e; --text: #e7e7e9; --muted: #9a9a9e;
  --line: #34343a; --accent: #5b9dff; --accent-dark: #4a86e8; --shadow: 0 1px 3px rgba(0,0,0,.4);
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] .ce-editable { background: #262629; color: var(--text); border-color: var(--line); }
[data-theme="dark"] .btn { background: #33333a; color: var(--text); border-color: #44444c; }
[data-theme="dark"] .btn.primary { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn.ghost { background: transparent; }
[data-theme="dark"] .ce-btn:hover, [data-theme="dark"] .cal-day:hover, [data-theme="dark"] .cal-nav:hover, [data-theme="dark"] .side-list a:hover { background: #2e2e33; }
[data-theme="dark"] .my-comment { background: #20273a; }
[data-theme="dark"] .ai-imp { background: #26203a; border-color: #3a3150; }
[data-theme="dark"] .tag, [data-theme="dark"] .cat { background: #2c2c31; }
[data-theme="dark"] .filter-chip { background: #2c2c31; }
[data-theme="dark"] .cal-dot { background: rgba(0,0,0,.5); }
[data-theme="dark"] .ce-toolbar, [data-theme="dark"] .ce-emojis { background: #1c1c1e; }
[data-theme="dark"] .ce-toolbar { border-color: var(--line); }
[data-theme="dark"] .alert.warn { background: #33290f; color: #f0d58a; border-color: #4a3d18; }
[data-theme="dark"] .ce-emojis, [data-theme="dark"] .comment { border-color: var(--line); }
.news-desc { margin: 0 0 8px; font-size: .88rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.my-comment {
  margin: 10px 0; padding: 8px 12px;
  border-left: 4px solid var(--accent);
  background: #f2f7ff; border-radius: 0 8px 8px 0;
  font-size: .9rem;
}
.comment-head {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: .75rem; color: var(--muted);
}
.comment-head .comment-label { font-weight: 700; color: var(--accent); }
.comment-head .comment-author { font-weight: 700; }
.comment-head time { margin-left: auto; }

/* 作者リンク（クリックでプロフィール表示） */
.author-link {
  border: none; background: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: .8rem; font-weight: 700; color: var(--accent);
}
.author-link:hover { text-decoration: underline; }

/* プロフィールパネル */
.profile-panel {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 14px; margin: 10px 0 16px;
  box-shadow: var(--shadow);
}
.profile-head { display: flex; gap: 12px; align-items: flex-start; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  background: #eef3fb; flex-shrink: 0;
}
.profile-avatar.fallback {
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1.4rem; font-weight: 800; background: #eef3fb;
}
.profile-meta { flex: 1; min-width: 0; }
.profile-name { font-weight: 800; font-size: 1rem; }
.profile-bio { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.profile-bio img { max-width: 100%; height: auto; border-radius: 6px; }
.profile-bio a { color: var(--accent); text-decoration: underline; }
.profile-edit { margin-top: 6px; }
.profile-posts { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.profile-posts-title { font-size: .85rem; font-weight: 700; margin-bottom: 6px; }
.profile-posts ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.profile-posts li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.profile-posts li:last-child { border-bottom: none; }
.profile-posts li a { color: var(--text); font-size: .88rem; }
.profile-posts li a:hover { color: var(--accent); }
.profile-posts li time { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.comment-head + .my-comment { margin-top: 4px; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* アラート */
.alert { padding: 10px 12px; border-radius: 8px; font-size: .9rem; margin-bottom: 14px; }
.alert.error { background: #fdecec; color: var(--danger); }
.msg { font-size: .85rem; color: var(--accent); }
.hint { display: block; margin-top: 4px; font-size: .72rem; color: var(--muted); }
.req { color: var(--danger); font-size: .75rem; font-weight: 600; margin-left: 4px; }

/* コメントエディタ（ブログ風ツールバー + 絵文字） */
.comment-editor { display: block; margin-top: 4px; }
.ce-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 4px;
  border: 1px solid var(--line); border-radius: 8px 8px 0 0;
  background: #fafafa;
}
.ce-btn {
  border: 1px solid transparent; background: transparent; color: var(--text);
  min-width: 30px; height: 30px; padding: 0 7px; border-radius: 5px;
  font-size: .85rem; cursor: pointer; font-family: inherit;
}
.ce-btn:hover { background: #fff; border-color: var(--line); }
.ce-btn b { font-weight: 800; }
.ce-btn i { font-style: italic; }
.ce-btn u { text-decoration: underline; }
.ce-btn s { text-decoration: line-through; }
.comment-editor textarea,
.ce-editable {
  width: 100%; min-height: 80px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 0 0 8px 8px;
  background: #fff; font-family: inherit; font-size: .95rem; line-height: 1.6;
  color: var(--text); outline: none; overflow-y: auto;
  text-align: left; box-sizing: border-box;
}
.ce-editable:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.ce-editable:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.ce-emojis {
  display: flex; flex-wrap: wrap; gap: 1px; padding: 6px;
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 8px 8px;
  background: #fff;
  max-height: 300px; overflow-y: auto;
}
.ce-emojis.hidden { display: none; }
.ce-group {
  width: 100%; flex-basis: 100%;
  color: var(--muted); font-size: .68rem; margin-top: 2px;
  border-top: 1px solid var(--line); padding-top: 4px;
}
.ce-group:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.ce-emoji {
  border: none; background: none; font-size: 1.2rem; line-height: 1;
  cursor: pointer; padding: 4px; border-radius: 5px;
}
.ce-emoji:hover, .ce-emoji:focus { background: #eef3fb; }

/* --- AI 感想 --- */
.ai-settings h2 { font-size: 1rem; }
.ai-box { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ai-label { font-weight: 700; font-size: .8rem; color: var(--accent); margin-bottom: 8px; }
.ai-imp {
  background: #f7f4ff; border: 1px solid #e7dffa; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px;
}
.ai-imp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ai-imp-head time { color: var(--muted); font-size: .7rem; margin-right: auto; }
.ai-model { font-weight: 700; font-size: .78rem; color: #6b44c4; }
.ai-content { font-size: .88rem; line-height: 1.6; white-space: pre-wrap; }
.ai-gen { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ai-model-select {
  width: auto; flex: 1; min-width: 140px; margin: 0;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  font-size: .85rem; background: #fff;
}
.ai-gen .btn { white-space: nowrap; }

/* コメント内HTML用 */
.my-comment h3, .my-comment h4, .my-comment h5 { margin: .6em 0 .3em; font-size: 1rem; }
.my-comment ul, .my-comment ol { margin: .4em 0 .4em 1.4em; padding: 0; }
.my-comment img { max-width: 100%; height: auto; border-radius: 6px; }
.my-comment a { color: var(--accent); text-decoration: underline; }
.my-comment pre { background: #f4f4f5; padding: 8px; border-radius: 6px; overflow-x: auto; }
.my-comment code { background: #f4f4f5; padding: 1px 5px; border-radius: 4px; }
.my-comment blockquote { border-left: 3px solid var(--line); margin: .4em 0; padding-left: 10px; color: var(--muted); }

/* モーダル */
dialog {
  border: none; border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
  width: min(92vw, 520px);
  padding: 24px;
}
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog h2 { margin: 0 0 14px; font-size: 1.1rem; }

/* スマホ対応 */
@media (max-width: 560px) {
  .news-card { flex-direction: column; }
  .thumb img { width: 100%; height: auto; max-height: 200px; }
  .row { flex-wrap: wrap; }
  .row .btn { flex: 1; }
}

/* ===== ブログ風レイアウト（左サイドバー） ===== */
.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.sidebar {
  width: 280px;
  flex-shrink: 0;
}
.content {
  flex: 1;
  min-width: 0;
}
.side-card { padding: 14px; margin-bottom: 16px; }
.side-card h3 {
  margin: 0 0 10px;
  font-size: .9rem;
  color: var(--text);
  border-bottom: 2px solid var(--line);
  padding-bottom: 6px;
}
.side-empty { color: var(--muted); font-size: .8rem; }

/* サイドバーリスト（カテゴリ） */
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { margin: 0; }
.side-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; border-radius: 6px; color: var(--text); font-size: .88rem;
}
.side-list a:hover { background: #eef3fb; color: var(--accent); }
.side-list li.active a { background: var(--accent); color: #fff; }
.side-list .cnt { font-size: .75rem; color: var(--muted); }
.side-list li.active .cnt { color: #fff; }

/* カレンダー */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-nav {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 1rem; text-decoration: none;
}
.cal-nav:hover { background: #eef3fb; }
.cal-title { font-size: .85rem; font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: .68rem; color: var(--muted); padding: 2px 0; }
.cal-cell { position: relative; text-align: center; aspect-ratio: 1; min-height: 26px; }
.cal-day, .cal-num {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: .8rem; text-decoration: none;
  color: var(--text); border-radius: 6px;
}
.cal-num { color: var(--muted); }
.cal-day:hover { background: #eef3fb; }
/* 選択中：セルを青にし、数字を白で確実に見せる */
.cal-cell.active { background: var(--accent); border-radius: 6px; }
.cal-cell.active .cal-day,
.cal-cell.active .cal-num { background: transparent; color: #fff; font-weight: 700; }
/* 今日：枠線＋青字（選択中は白字を優先） */
.cal-cell.today .cal-day,
.cal-cell.today .cal-num { font-weight: 800; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.active.today .cal-day,
.cal-cell.active.today .cal-num { color: #fff; box-shadow: none; }
/* 件数ドット：右下配置で数字を隠さない */
.cal-dot {
  position: absolute; bottom: 1px; right: 2px; min-width: 12px; height: 12px; line-height: 12px;
  border-radius: 999px; background: rgba(255,255,255,.9); color: #c53030;
  font-size: .55rem; text-align: center; padding: 0 2px;
}
.cal-dot.multi { color: var(--accent); }

/* タグクラウド */
.tagcloud { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tagcloud-item { color: var(--accent); text-decoration: none; line-height: 1.4; }
.tagcloud-item:hover { text-decoration: underline; }
.tagcloud-item.active { font-weight: 800; }
.tagcloud-item .cnt { color: var(--muted); font-size: .7rem; }

/* フィルタ表示 */
.filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: .8rem; }
.filter-label { color: var(--muted); }
.filter-chip { background: #eef3fb; color: var(--accent); padding: 2px 10px; border-radius: 999px; }

/* 記事内カテゴリ */
.cat {
  display: inline-block; background: #f0f0f2; color: var(--text); font-size: .72rem;
  padding: 2px 10px; border-radius: 999px; margin-bottom: 6px; text-decoration: none;
}
.cat:hover { background: var(--accent); color: #fff; }
.news-meta-row { margin: 6px 0; }

/* スマホ：サイドバーを上に積む */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; order: -1; }
}
@media (max-width: 560px) {
  .cal-cell { min-height: 30px; }
}

/* --- フッター --- */
.site-footer {
  text-align: center; padding: 24px 16px;
  color: var(--muted); font-size: .78rem;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}
.login-body .site-footer { margin-top: auto; }
.footer-links {
  display: flex; gap: 6px 16px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 10px;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
