/* 株主優待 開示一覧 */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --border: #d8dbe0;
  --link: #0b57d0;
  --accent: #b4442a;
  --warn-bg: #fff4d6;
  --warn-text: #6b4a00;
  --error-bg: #fde8e8;
  --error-text: #8a1c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--link); }
a:hover { text-decoration: none; }

main, .site-header, .site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- ヘッダー ---- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 20px;
  padding-bottom: 12px;
}
.site-header h1 { margin: 0; font-size: 1.5rem; }
.site-header h1 a { color: inherit; text-decoration: none; }
.last-fetch { margin: 0; color: var(--muted); font-size: .875rem; }

/* ---- お知らせ ---- */
.notice { padding: 10px 14px; border-radius: 6px; margin: 0 0 12px; }
.notice-warn { background: var(--warn-bg); color: var(--warn-text); }
.notice-error { background: var(--error-bg); color: var(--error-text); }

/* ---- 絞り込み ---- */
.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.field { display: flex; flex-direction: column; gap: 2px; }
.field-q { flex: 1 1 240px; }
.field-label, .filter-cats legend { font-size: .8125rem; color: var(--muted); }
select, input[type="search"] {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  min-height: 36px;
}
input[type="search"] { width: 100%; }
.filter-cats { border: 0; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.filter-cats legend { padding: 0; margin-bottom: 4px; }
.cat-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; }
.filter-actions button {
  font: inherit;
  padding: 6px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--link);
  color: #fff;
  cursor: pointer;
  min-height: 36px;
}
.filter-actions .reset, .filter-actions .rss { font-size: .875rem; }

.count { margin: 8px 0; }
.empty { padding: 24px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }

/* ---- 一覧 ---- */
.list {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
}
.list th, .list td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.list th { background: #eef0f3; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.list .col-date, .list .col-code, .list .col-cat { white-space: nowrap; }
.list .col-market { white-space: nowrap; color: var(--muted); }
.list tbody tr:hover { background: #fafbfc; }

/* ---- ラベル（区分ごとに色を固定） ---- */
.cat {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .8125rem;
  line-height: 1.6;
  color: #fff;
  white-space: nowrap;
}
.cat-correct  { background: #6b7280; }
.cat-abolish  { background: #c62828; }
.cat-expand   { background: #2e7d32; }
.cat-new      { background: #1565c0; }
.cat-change   { background: #ef6c00; }
.cat-continue { background: #00838f; }
.cat-decide   { background: #6a1b9a; }
.cat-other    { background: #8d6e63; }

.badge-new, .badge-reit {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  font-size: .75rem;
  line-height: 1.6;
  vertical-align: 1px;
}
.badge-new { background: var(--accent); color: #fff; font-weight: 600; }
.badge-reit { border: 1px solid var(--muted); color: var(--muted); }
.expired { display: inline-block; font-size: .75rem; color: var(--muted); }

/* ---- ページ送り ---- */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 16px 0; }
.pager a, .pager span {
  min-width: 36px;
  padding: 6px 10px;
  text-align: center;
  border-radius: 6px;
}
.pager a { background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
.pager .current { background: var(--link); color: #fff; font-weight: 600; }
.pager .gap { color: var(--muted); }

/* ---- フッター ---- */
.site-footer {
  margin-top: 24px;
  padding-top: 12px;
  padding-bottom: 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .8125rem;
}
.site-footer p { margin: 4px 0; }

/* ---- 画面幅640px以下：1件1枚のカード表示 ---- */
@media (max-width: 640px) {
  .list, .list thead, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list { border: 0; background: transparent; }
  .list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .list tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 6px 0;
  }
  .list td {
    border: 0;
    position: relative;
    padding: 3px 12px 3px calc(5.5em + 20px);
    white-space: normal !important;
  }
  .list td::before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    width: 5.5em;
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 400;
    line-height: 1.85;
  }
  .list td.col-title { font-weight: 600; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1e2126;
    --text: #e6e8eb;
    --muted: #9aa1ab;
    --border: #353a42;
    --link: #8ab4f8;
    --warn-bg: #3a2f10;
    --warn-text: #f3d48a;
    --error-bg: #3d1717;
    --error-text: #f4a9a9;
  }
  .list th { background: #262a30; }
  .list tbody tr:hover { background: #23272d; }
  .filter-actions button { color: #10131a; }
  .pager .current { color: #10131a; }
}
