:root{
  --bg:#ffffff;
  --text:#111;
  --muted:#666;
  --border:#eee;
  --chip:#f3f3f3;
  --shadow: 0 6px 18px rgba(0,0,0,.06);
  --radius:12px;
  --radius2:10px;
  --max:1100px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  color:var(--text);
  background:var(--bg);
}

a{ color:inherit; }

.container{
  max-width:var(--max);
  margin:0 auto;
  padding:18px;
}

/* ============ Header ============ */
.header{
  border-bottom:1px solid var(--border);
  background:#fff;
  position:sticky;
  top:0;
  z-index:10;
}
.header__inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:14px 18px;
}
.logo{
  text-decoration:none;
  font-weight:900;
}
.nav{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
}
.nav a{
  color:#333;
  text-decoration:none;
}
.nav a:hover{ text-decoration:underline; }

/* ============ Hero / Search ============ */
.hero{ padding:10px 0 6px; }
.hero h1{ margin:0 0 6px; font-size:24px; }
.muted{ color:var(--muted); font-size:14px; }

.searchbar{
  display:flex;
  gap:10px;
  margin-top:12px;
}
.searchbar input{
  flex:1;
  padding:12px 14px;
  border-radius:var(--radius2);
  border:1px solid #ddd;
  font-size:16px;
}

/* Sort row */
.sortRow{
  display:flex;
  gap:10px;
  align-items:center;
  margin:10px 0;
  flex-wrap:wrap;
}
.sortLabel{
  color:#555;
  font-size:13px;
  white-space:nowrap;
}
.sortSelect{
  min-width:220px;
  height:40px;
  border:1px solid #ddd;
  border-radius:10px;
  padding:8px 10px;
  background:#fff;
}

/* ============ Layout ============ */
.grid{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap:14px;
  align-items:start;
  margin-top:10px;
}

.panel{
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px;
  background:#fff;
  box-shadow: var(--shadow);
}
.panel__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}
.panel__title{ font-weight:900; }

.filter{ margin:10px 0 16px; }
.filter__title{ font-weight:800; margin-bottom:8px; }
.filter__list{ display:grid; gap:8px; }

.chk{
  display:flex;
  gap:10px;
  align-items:center;
  cursor:pointer;
  user-select:none;
}
.chk input{ transform: translateY(1px); }

/* ============ Results ============ */
.results{ display:grid; gap:10px; }
.results__meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}

.list{ display:grid; gap:10px; }

.card{
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px;
  background:#fff;
  box-shadow: var(--shadow);
}
.card__top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.card__title{
  font-size:18px;
  font-weight:900;
  margin:0;
  text-decoration:none;
  display:inline-block;
}
.card__sub{ margin-top:6px; color:#555; }

.chips{
  margin-top:8px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.chip{
  background:var(--chip);
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  color:#333;
}

/* 給与チップ強調 + 給与なし薄く（Bの実装） */
.chip--pay{
  font-weight:800;
  border:1px solid #ddd;
}
.card--nopay{
  opacity:.82;
}

.small{
  font-size:12px;
  color:#777;
  white-space:nowrap;
}

/* ============ Buttons ============ */
.btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #ddd;
  background:#fff;
  cursor:pointer;
}
.btn--ghost{ background:#fafafa; }
.btn--link{
  border:none;
  background:transparent;
  padding:0;
  cursor:pointer;
  color:#333;
  text-decoration:underline;
}

/* ============ Empty / Utility ============ */
.hidden{ display:none; }

.empty{
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  background:#fff;
}

/* ============ Active filter bar (sticky) ============ */
/* “現在の検索条件”バー（①の実装） */
.activeChips{
  position: sticky;
  top: 58px;                 /* ヘッダー直下。必要なら 50〜80 で微調整 */
  z-index: 9;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  margin: 8px 0 12px;

  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.activeChip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--border);
  background:#fff;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  box-shadow: var(--shadow);
}

.activeChip__x{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:14px;
  line-height:1;
  color:#777;
}
.activeChip__x:hover{ color:#111; }

/* すべてクリアだけ目立たせる（:has 対応ブラウザ用） */
.activeChip:has([data-x="__clearall__"]){
  background:#fafafa;
  border-style:dashed;
}
.activeChip:has([data-x="__clearall__"]) .activeChip__x{
  font-weight:900;
  color:#333;
  font-size:0;                 /* 元の×を隠す */
}
.activeChip:has([data-x="__clearall__"]) .activeChip__x::before{
  content:"↺";
  font-size:14px;
}

/* ============ Footer ============ */
.footer{
  border-top:1px solid var(--border);
  color:var(--muted);
  margin-top:20px;
}

/* ============ Responsive ============ */
@media (max-width: 900px){
  .grid{ grid-template-columns:1fr; }
  .header__inner{ padding:14px; }
  .container{ padding:14px; }

  /* モバイルではselectやボタンを詰めすぎない */
  .sortSelect{ min-width: 0; width: 100%; }
  .sortRow .btn{ width: 100%; }

  /* stickyバーが窮屈なら少しだけ上げる/下げる */
  .activeChips{ top: 56px; }
}

/* 条件バー見出し */
.activeBar__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  width:100%;
  font-size:12px;
  color:var(--muted);
  font-weight:900;
  margin-bottom:6px;
}

.activeBar__count{
  font-size:13px;
  color:#333;
}