/* OMC IT事業部 調達ポータル
 * 配色は WCAG 2.2 AA を満たすよう調整済み（文字 4.5:1 以上、入力欄・ボタンの枠やフォーカス表示 3:1 以上）。
 */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --border: #d5dce4;          /* 区切り線（装飾） */
  --control-border: #76828f;  /* 入力欄・ボタンの枠（背景と 3:1 以上） */
  --text: #1b2430;
  --muted: #4f5d6d;
  --primary: #1a56b0;
  --primary-hover: #154a99;
  --primary-weak: #e7effb;
  --primary-text: #ffffff;
  --focus: #1a56b0;
  --danger: #b42318;
  --danger-weak: #fdeceb;
  --warn: #8a4b00;
  --warn-weak: #fff4e5;
  --ok: #1e6b2a;
  --ok-weak: #e7f5ea;
  --neutral-weak: #eceff3;
  --cat-goods: #1a56b0;
  --cat-works: #8a4b00;
  --cat-services: #1e6b2a;
  --cat-other: #4f5d6d;
  --cat-text: #ffffff;
  --tag-ai-bg: #f1e8fd;
  --tag-ai: #5b2fa0;
  --tag-cms-bg: #e3f3ef;
  --tag-cms: #135e4d;
  --star: #b26f00;
  --visited: #6b3fa0;         /* 閲覧済の案件名（背景と 4.5:1 以上） */
  --mark: #fff0a0;
  --backdrop: rgb(16 21 28 / .5);
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 1px 3px rgb(16 24 40 / .08);
  --radius: 12px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151c;
    --surface: #18202a;
    --surface-2: #1e2834;
    --border: #2e3a48;
    --control-border: #7d8b9b;
    --text: #e8edf3;
    --muted: #aab6c4;
    --primary: #8ab4ff;
    --primary-hover: #a6c6ff;
    --primary-weak: #1d2d4a;
    --primary-text: #0b1220;
    --focus: #8ab4ff;
    --danger: #ff8a80;
    --danger-weak: #3b1e1d;
    --warn: #ffb866;
    --warn-weak: #3a2a16;
    --ok: #7fd690;
    --ok-weak: #18311d;
    --neutral-weak: #253141;
    --cat-goods: #8ab4ff;
    --cat-works: #ffb866;
    --cat-services: #7fd690;
    --cat-other: #aab6c4;
    --cat-text: #0b1220;
    --tag-ai-bg: #2e2342;
    --tag-ai: #d4b8ff;
    --tag-cms-bg: #15302a;
    --tag-cms: #8ee0cb;
    --star: #ffc94d;
    --visited: #c9a7ff;
    --mark: #5c4d00;
    --backdrop: rgb(0 0 0 / .6);
    --shadow: none;
    color-scheme: dark;
  }
}

/* ---- 基本 ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
}
a { color: var(--primary); text-underline-offset: .18em; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::placeholder { color: var(--muted); opacity: 1; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; margin: -1px !important; padding: 0 !important; border: 0 !important;
}
.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 50;
  background: var(--primary); color: var(--primary-text); padding: 10px 16px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 8px; color: var(--primary-text); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
code { background: var(--neutral-weak); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

/* ---- 入力欄・ボタン ---- */
.input {
  min-height: 36px; padding: 4px 10px; border: 1px solid var(--control-border); border-radius: 8px;
  background: var(--surface); color: var(--text); max-width: 100%;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border: 1px solid var(--control-border); border-radius: 8px;
  background: var(--surface); font-size: 14px; font-weight: 600; white-space: nowrap; line-height: 1.3;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-text); }
.btn-block { width: 100%; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text);
}
.icon-btn:hover { border-color: var(--control-border); }
.icon-btn .icon { width: 22px; height: 22px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); text-decoration: underline; text-underline-offset: .18em; font-size: inherit; }
.field-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.field-hint { display: block; font-size: 12px; color: var(--muted); }

/* ---- ヘッダー ---- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 6px 16px 4px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-mark rect { fill: var(--primary); }
.brand-mark path { fill: var(--surface); }
.brand-mark .brand-line { fill: none; stroke: var(--primary); stroke-width: 2; }
.brand-title { font-size: 18px; line-height: 1.35; margin: 0; letter-spacing: .02em; }
.brand-sub { margin: 0; font-size: 12px; color: var(--muted); }
.view-nav ul { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.view-nav button {
  min-height: 40px; padding: 4px 14px; border: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0;
  background: none; color: var(--muted); font-weight: 700; font-size: 14px;
}
.view-nav button:hover { color: var(--text); background: var(--neutral-weak); }
.view-nav button[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.header-status {
  max-width: 1280px; margin: 0 auto; padding: 2px 16px 5px; font-size: 13px; color: var(--muted);
}
.header-status strong { color: var(--text); }
.header-status.stale { background: var(--danger-weak); max-width: none; }
.stale-msg { color: var(--danger); font-weight: 700; }

main { max-width: 1280px; margin: 0 auto; padding: 12px 16px 8px; }

/* ---- キーワード ---- */
.search {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; margin-bottom: 10px;
}
.search-label { font-weight: 700; font-size: 15px; }
.search-row { display: flex; gap: 8px; min-width: 0; }
.search-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 14px; font-size: 16px;
  border: 1px solid var(--control-border); border-radius: 10px; background: var(--surface);
}
.search-row .btn-primary { min-height: 44px; padding: 8px 22px; font-size: 15px; }
.hint { grid-column: 2; margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---- 表示範囲・状態（ラジオボタン） ---- */
.view-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.segmented, .pills { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; }
.segmented label, .pills label { position: relative; display: flex; }
.segmented input, .pills input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.opt {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 12px;
  font-weight: 700; font-size: 13.5px; color: var(--muted); line-height: 1.3;
}
.count { margin-left: 4px; font-weight: 400; font-variant-numeric: tabular-nums; }
.segmented { border: 1px solid var(--control-border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.segmented label + label .opt { border-left: 1px solid var(--control-border); }
.pills { gap: 5px; }
.pills .opt { border: 1px solid var(--control-border); border-radius: 999px; background: var(--surface); padding: 4px 11px; min-height: 36px; }
.segmented input:checked + .opt, .pills input:checked + .opt { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.segmented input:checked + .opt::before, .pills input:checked + .opt::before {
  content: "✓"; content: "✓" / ""; /* 読み上げには含めない（選択状態はラジオボタンとして伝わる） */ font-weight: 700;
}
.segmented input:focus-visible + .opt { outline: 3px solid var(--focus); outline-offset: -5px; }
.pills input:focus-visible + .opt { outline: 3px solid var(--focus); outline-offset: 2px; }
.segmented label:hover .opt, .pills label:hover input:not(:checked) + .opt { color: var(--text); }
.pills label:hover input:not(:checked) + .opt { border-color: var(--primary); }

/* ---- 絞り込み（画面が広いとき：一覧の上にすべて表示） ---- */
.filter-launch { display: none; margin-bottom: 10px; }
.btn-filter { min-height: 44px; font-size: 15px; }
.filters-count { font-weight: 400; font-size: .9em; margin-left: 2px; }
.filters-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.filters-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  padding: 4px 10px 4px 14px; border-bottom: 1px solid var(--border);
}
.filters-head h2 { font-size: 15px; margin: 0; }
.filters-head-actions { display: flex; gap: 6px; }
.filters-panel.collapsed .filters-head { border-bottom: 0; }
.filters-panel.collapsed .filters-slot { display: none; }
.filters-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; padding: 0 14px 4px; }
.filters-col { min-width: 0; }
.frow {
  display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 2px 10px; align-items: start;
  padding: 5px 0; border-top: 1px solid var(--border);
}
.filters-col > .frow:first-child { border-top: 0; }
.frow-label { font-weight: 700; font-size: 13px; line-height: 1.35; padding-top: 6px; }
.frow-body { min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 2px 4px; min-width: 0; }
.check {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; max-width: 100%;
  padding: 0 7px 0 3px; border: 1px solid transparent; border-radius: 6px; font-size: 13.5px; line-height: 1.35; cursor: pointer;
}
.check:hover { background: var(--neutral-weak); }
.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.check:has(input:checked) { background: var(--primary-weak); border-color: var(--primary); font-weight: 700; }
.check .label { min-width: 0; overflow-wrap: anywhere; }
.check .num { color: var(--muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.check.zero .label { color: var(--muted); }
.facet-note { font-size: 12px; color: var(--muted); margin: 0 0 0 3px; line-height: 1.4; }
.more-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; border: 1px dashed var(--control-border); border-radius: 6px;
  background: none; color: var(--primary); font-size: 13px; font-weight: 600;
}
.more-btn .icon { width: 14px; height: 14px; transition: transform .15s; }
.more-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.more-btn:hover { border-style: solid; }
#f-org { width: 100%; max-width: 18em; }
.org-field { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.input { min-height: 34px; }
.range { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.range input { width: 10.5em; }
.filters-body .input { min-height: 34px; padding: 2px 8px; }

/* 地域（地方ごとにチェック。「都道府県を個別に選ぶ」で都道府県を表示） */
.pref-panel { flex-basis: 100%; margin-top: 4px; padding: 4px 8px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.pref-group { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 0 8px; align-items: start; padding: 2px 0; }
.pref-group + .pref-group { border-top: 1px dashed var(--border); }
.pref-group-label { font-size: 12.5px; font-weight: 700; color: var(--muted); padding-top: 5px; }

/* ---- 絞り込み（画面が狭い・低いとき：ボタンで前面に表示） ---- */
.filters-modal .filter-launch { display: flex; }
.filters-modal .filters-panel { display: none; }
.filters-dialog {
  padding: 0; border: 0; margin: 0 0 0 auto; width: min(560px, 100%); max-width: 100%;
  height: 100%; max-height: 100%; background: var(--surface); color: var(--text);
  box-shadow: 0 0 24px rgb(0 0 0 / .25);
}
.filters-dialog[open] { display: flex; flex-direction: column; }
.filters-dialog::backdrop { background: var(--backdrop); }
html:has(.filters-dialog[open]) { overflow: hidden; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 17px; margin: 0; }
.dialog-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 12px; }
.dialog-foot {
  display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: var(--surface);
}
.dialog-foot .btn { flex: 1; min-height: 48px; font-size: 15px; }
.dialog-body .filters-body { display: block; padding: 0; }
.dialog-body .frow { grid-template-columns: minmax(0, 1fr); padding: 10px 0; }
.dialog-body .filters-col + .filters-col > .frow:first-child { border-top: 1px solid var(--border); }
.dialog-body .frow-label { font-size: 14px; padding-top: 0; }
.dialog-body .check { min-height: 40px; }
.dialog-body .more-btn { min-height: 40px; }
.dialog-body .pref-group { grid-template-columns: minmax(0, 1fr); }
.dialog-body #f-org, .dialog-body .range input { min-height: 44px; font-size: 16px; }
.dialog-body #f-org { max-width: none; }

/* ---- 指定中の条件 ---- */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 12px; }
.af-label { font-size: 13px; font-weight: 700; }
.af-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.af-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 8px 2px 12px;
  border: 1px solid var(--primary); border-radius: 999px; background: var(--primary-weak); color: var(--text); font-size: 13px; line-height: 1.3;
}
.af-chip .icon { width: 14px; height: 14px; color: var(--primary); }
.af-chip:hover { background: var(--surface); }
.af-clear { min-height: 32px; font-size: 13px; }

/* ---- 結果 ---- */
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 8px; }
.results-heading { margin: 0; font-size: 15px; font-weight: 400; }
.results-heading strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sort { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.sort label { color: var(--muted); font-weight: 700; }

.saved-searches { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.saved-searches:empty { display: none; }
.saved-label { font-size: 13px; font-weight: 700; }
.chip { display: inline-flex; align-items: stretch; border: 1px solid var(--control-border); border-radius: 999px; background: var(--surface); font-size: 13px; overflow: hidden; }
.chip button { border: 0; background: none; min-height: 32px; padding: 2px 12px; }
.chip button:hover { background: var(--neutral-weak); }
.chip .chip-del { padding: 2px 10px 2px 6px; color: var(--muted); }

.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.item.is-closed { background: var(--surface-2); }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-badges { order: -1; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 4px; }
.badge {
  display: inline-block; font-size: 12px; line-height: 1.6; padding: 0 7px; border-radius: 4px;
  background: var(--neutral-weak); color: var(--muted); font-weight: 700;
}
.badge-new { background: var(--danger); color: var(--surface); }
.badge-tag { background: var(--primary-weak); color: var(--primary); }
.badge-tag[data-tag="ai"] { background: var(--tag-ai-bg); color: var(--tag-ai); }
.badge-tag[data-tag="cms"] { background: var(--tag-cms-bg); color: var(--tag-cms); }
.badge-tag[data-tag="it"] { background: var(--neutral-weak); color: var(--muted); }
.badge-check { background: transparent; color: var(--warn); border: 1px solid var(--warn); line-height: 1.45; }
.badge-otype { background: var(--surface); color: var(--text); border: 1px solid var(--control-border); line-height: 1.45; }
.badge-otype.is-focus { border-color: var(--primary); color: var(--primary); }
.badge-cat { color: var(--cat-text); }
.badge-cat[data-cat="物品"] { background: var(--cat-goods); }
.badge-cat[data-cat="工事"] { background: var(--cat-works); }
.badge-cat[data-cat="役務"] { background: var(--cat-services); }
.badge-cat[data-cat="その他"] { background: var(--cat-other); }
.item-title { margin: 0 0 6px; font-size: 16.5px; line-height: 1.5; }
.item-link { color: var(--primary); text-decoration: none; }
.item-link:hover { text-decoration: underline; color: var(--primary-hover); }
.item-link .icon { width: 14px; height: 14px; margin-left: 3px; vertical-align: -1px; }
.item-link:not([href]) { color: var(--text); }
.item-title mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.item-meta { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 0; font-size: 13.5px; color: var(--muted); }
.item-meta > div { display: flex; flex-wrap: wrap; gap: 0 4px; min-width: 0; }
.item-meta dt { white-space: nowrap; }
.item-meta dt::after { content: "："; }
.item-meta dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.item-meta .note-row { flex-basis: 100%; flex-wrap: nowrap; }
.item-meta .note-row dd { background: var(--primary-weak); border-radius: 4px; padding: 0 6px; }
.item-meta .note-row dd.generic-link { background: var(--neutral-weak); }
.qual-row dd { background: none !important; padding: 0 !important; }
.qual-text { display: block; color: var(--muted); font-size: 12.5px; }
.more-link { margin-right: 10px; display: inline-block; min-height: 24px; }
.elig { display: inline-block; font-size: 12px; font-weight: 700; padding: 0 7px; border-radius: 4px; white-space: nowrap; }
.elig-ok { background: var(--ok-weak); color: var(--ok); }
.elig-check { background: var(--warn-weak); color: var(--warn); }
.elig-ng { background: var(--danger-weak); color: var(--danger); }
.elig-unknown { background: var(--neutral-weak); color: var(--muted); }
.deadline-note { font-size: 12px; color: var(--warn); background: var(--warn-weak); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.deadline-note.deadline-ok { color: var(--ok); background: var(--ok-weak); }
.copy-title {
  min-height: 30px; margin-left: 4px; padding: 2px 10px; border: 1px solid var(--control-border); border-radius: 6px;
  background: var(--surface); font-size: 13px; font-weight: 600;
}
.copy-title:hover { border-color: var(--primary); color: var(--primary); }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; min-width: 88px; }
.status { font-size: 12.5px; font-weight: 700; padding: 1px 10px; border-radius: 999px; border: 1px solid transparent; }
.status.open { background: var(--ok-weak); color: var(--ok); }
.status.closed { background: var(--neutral-weak); color: var(--muted); border-color: var(--control-border); }
.days-left { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.days-left.urgent { color: var(--danger); }
.days-left.soon { color: var(--warn); }
.fav-btn {
  margin-top: auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); font-size: 24px; line-height: 1;
}
.fav-btn:hover { border-color: var(--control-border); }
.item-actions { margin-top: auto; display: flex; gap: 2px; }
.item-actions .fav-btn { margin-top: 0; }
.seen-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted);
}
.seen-btn .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.seen-btn:hover { border-color: var(--control-border); }
.seen-btn[aria-pressed="true"] { color: var(--visited); }
.seen-btn[aria-pressed="true"] .icon circle { fill: currentColor; }
.item.is-seen .item-link[href] { color: var(--visited); }
.badge-seen { background: transparent; color: var(--visited); border: 1px solid var(--visited); line-height: 1.45; }
.marks-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-btn { cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.fav-btn[aria-pressed="true"] { color: var(--star); }

.empty {
  background: var(--surface); border: 1px dashed var(--control-border); border-radius: var(--radius);
  padding: 28px 16px; text-align: center; color: var(--text);
}
.empty p { margin: 0 0 12px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ---- ページ送り ---- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 14px 0; }
.pager:empty { display: none; }
#pager-top { margin: 0 0 10px; }
#pager { justify-content: center; }
.page-buttons { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.pager button {
  min-width: 40px; min-height: 40px; padding: 4px 10px; border: 1px solid var(--control-border); border-radius: 8px;
  background: var(--surface); font-size: 14px; font-variant-numeric: tabular-nums;
}
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button[aria-current="page"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: 700; }
.pager button:disabled { color: var(--muted); border-style: dashed; cursor: not-allowed; }
.pager .gap { padding: 6px 4px; color: var(--muted); }
.page-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; }
.page-input { width: 5em; min-height: 40px; padding: 4px 8px; border: 1px solid var(--control-border); border-radius: 8px; background: var(--surface); font-size: 16px; }
.page-input[aria-invalid="true"] { border: 2px solid var(--danger); }
.page-total { color: var(--muted); }
.page-error { color: var(--danger); font-weight: 700; flex-basis: 100%; }
.page-error:empty { display: none; }

/* ---- 情報源・更新状況 ---- */
.view > h2 { font-size: 18px; margin: 8px 0 12px; }
.status-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fetch-status { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.fetch-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.fetch-card h3 { font-size: 15px; margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fetch-card p { margin: 2px 0; font-size: 13.5px; color: var(--muted); }
.fetch-card details { font-size: 13px; margin-top: 6px; }
.fetch-card summary { cursor: pointer; min-height: 24px; }
.fetch-card ul { margin: 4px 0; padding-left: 18px; }
.pill { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.pill.ok { background: var(--ok-weak); color: var(--ok); }
.pill.partial { background: var(--warn-weak); color: var(--warn); }
.pill.error { background: var(--danger-weak); color: var(--danger); }
.company-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.company-card h3 { font-size: 15px; margin: 0 0 6px; }
.company-card p { margin: 6px 0 0; font-size: 13px; }
.company-quals { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.company-quals li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; }
.company-quals .q-name { font-weight: 700; }
.company-quals .q-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.warnings { background: var(--warn-weak); border-radius: var(--radius); padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px; }
.warnings ul { margin: 4px 0 0; padding-left: 18px; }
.sources-filter { width: 100%; max-width: 360px; margin-bottom: 8px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sources-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sources-table th, .sources-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.sources-table th { background: var(--surface-2); white-space: nowrap; }
.sources-table tr:last-child td { border-bottom: 0; }

/* ---- 使い方 ---- */
.prose { max-width: 860px; }
.prose h3 { font-size: 16px; margin: 22px 0 6px; }
.prose li { margin: 4px 0; }
.prose .table-wrap { display: inline-block; max-width: 100%; }
.help-table { border-collapse: collapse; font-size: 14px; }
.help-table th, .help-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.help-table thead th { background: var(--surface-2); }
.help-table tbody th { font-weight: 400; }

/* ---- フッター ---- */
.site-footer { max-width: 1280px; margin: 0 auto; padding: 16px 16px 32px; font-size: 12.5px; color: var(--muted); }
.site-footer p { margin: 4px 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 16px rgb(0 0 0 / .2);
}

/* ---- パスコード入力 ---- */
.gate {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto;
}
.gate-box {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow);
}
.gate-box .brand-mark { width: 44px; height: 44px; display: block; margin: 0 auto; }
.gate-title { font-size: 19px; margin: 8px 0 4px; text-align: center; }
.gate-box > p { font-size: 14px; margin: 0 0 16px; }
.gate-box input[type="password"] { width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px; margin-bottom: 10px; }
.gate-remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 14px; min-height: 32px; cursor: pointer; }
.gate-remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.gate-box .btn-primary { min-height: 48px; font-size: 16px; }
.gate-error { color: var(--danger); font-weight: 700; min-height: 1.6em; margin: 10px 0 0 !important; }
.gate-box input[type="text"] { width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px; margin-bottom: 4px; }
.gate-box .field-hint { display: block; font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.account-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 14px; padding: 0; border: 1px solid var(--control-border); border-radius: 10px; overflow: hidden; }
.account-mode label { position: relative; display: block; }
.account-mode input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.account-mode .opt { display: flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 700; font-size: 15px; color: var(--text); background: var(--surface); }
.account-mode label + label .opt { border-left: 1px solid var(--control-border); }
.account-mode input:checked + .opt { background: var(--primary); color: var(--primary-text); }
.account-mode input:focus-visible + .opt { outline: 3px solid var(--focus); outline-offset: -3px; }
.account-wait { min-height: 1.4em; margin: 6px 0 0 !important; }
#account-offline { margin-top: 8px; }

/* ---- 画面幅に応じた調整 ---- */
@media (max-width: 1100px) {
  .frow { grid-template-columns: 7.5em minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .header-inner { padding: 6px 12px; }
  .brand-title { font-size: 17px; }
  .brand-sub { display: none; }
  .view-nav { width: 100%; }
  .view-nav ul { flex-wrap: nowrap; }
  .view-nav li { flex: 1; }
  .view-nav button { width: 100%; padding: 6px 4px; font-size: 13.5px; }
  .header-status { padding: 4px 12px 6px; }
  main { padding: 12px 12px 8px; }
  .search { grid-template-columns: minmax(0, 1fr); }
  .search-label { margin-bottom: 4px; }
  .hint { grid-column: 1; }
  .view-controls { gap: 8px; }
  .segmented { width: 100%; }
  .segmented label { flex: 1; }
  .segmented .opt { width: 100%; justify-content: center; padding: 4px 8px; min-height: 44px; }
  .pills { gap: 6px 4px; }
  .pills .opt { padding: 4px 10px; min-height: 40px; }
  /* 補足（「（3日以内）」など）は狭い画面では表示を省き、読み上げでは伝える */
  .opt-sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .btn-filter { width: 100%; }
  .results-head { align-items: flex-start; }
  .toolbar-actions { width: 100%; }
  .sort { flex: 1 1 100%; }
  .sort select { flex: 1; min-height: 44px; }
  .toolbar-actions .btn { flex: 1; min-height: 44px; padding: 6px 8px; }
  .item { flex-direction: column; gap: 4px; padding: 12px; }
  .item-side { flex-direction: row; align-items: center; min-width: 0; }
  .item-actions { margin: 0 0 0 auto; }
  .item-meta .note-row { flex-wrap: wrap; }
  .pager { gap: 8px; }
  .pager button { min-width: 44px; min-height: 44px; }
  .page-input { min-height: 44px; }
}

/* ---- 動きを減らす設定 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---- ハイコントラスト（Windows の強制カラー） ---- */
@media (forced-colors: active) {
  .account-mode input:checked + .opt { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .segmented input:checked + .opt, .pills input:checked + .opt, .pager button[aria-current="page"] {
    forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight;
  }
  .badge, .elig, .status, .deadline-note, .pill, .af-chip, .pref-panel, .check:has(input:checked), .item, .filters-panel { border: 1px solid CanvasText; }
  .brand-mark rect { fill: CanvasText; }
  .brand-mark path { fill: Canvas; }
  .brand-mark .brand-line { stroke: CanvasText; }
  .fav-btn[aria-pressed="true"] { color: Highlight; }
  .seen-btn[aria-pressed="true"] { color: Highlight; }
  .item.is-seen .item-link[href] { color: VisitedText; }
  .badge-seen { border-color: CanvasText; color: CanvasText; }
  .view-nav button { border-bottom-color: Canvas; }
  .view-nav button[aria-current="page"] { border-bottom-color: Highlight; }
  :focus-visible { outline-color: Highlight; }
}

/* ---- 印刷 ---- */
@media print {
  .skip-link, .view-nav, .filter-launch, .filters-panel, .filters-dialog, .active-filters, .toolbar-actions,
  .saved-searches, .pager, .fav-btn, .seen-btn, .marks-tools, .copy-title, .site-footer button, .toast { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .item { break-inside: avoid; box-shadow: none; border-color: #999; }
  .item-link { color: #000; }
  .item-link[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #333; word-break: break-all; }
}
