.container {
  max-width: 1080px;
  width: 98%;
  margin: 0 auto;
  border-radius: 18px;
  padding: 36px 40px 40px 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: background 0.3s;
}
.section-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 18px 0 10px 0;
}
.section-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #D2497E;
  flex-shrink: 0;
}
.section-title-text {
  font-size: 1.4rem;
  font-weight: bold;
  color: #D2497E;
  letter-spacing: .04em;
  margin-right: 6px;
  white-space: nowrap;
}
.section-title-border {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, #e1e7f0 50%, #fff 100%);
  border-radius: 1.5px;
  margin-left: 8px;
}
.section-title-underline {
  display: inline-block;
  width: 100%;
  border-bottom: 2px solid #e1e7f0;
  padding-bottom: 2px;
  margin-bottom: 5px;
}

.service-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 18px 0 10px 0;
}
.service-title-text {
  font-size: 1.15rem;
  font-weight: bold;
  color: #1565C0;
  letter-spacing: .04em;
  margin-right: 6px;
  white-space: nowrap;
}

.service-title-underline {
  display: inline-block;
  width: 100%;
  border-bottom: 2px solid #1565C0;
  padding-bottom: 2px;
  margin-bottom: 5px;
}

.radio-group { 
  display: flex; 
  gap: 28px; 
  margin: 6px 0 20px 0; 
  align-items: center; 
}

.radio-group-text { 
  font-size: 1.15rem; 
  color: #1565C0; 
  font-weight: bold;
  cursor: pointer;
  padding-top: 20px;
  padding-right: 20px;
}

.radio-options {
  display: flex;
  gap: 16px;
}

.radio-label { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  font-size: 1rem; 
  color: #24324b; 
  cursor: pointer; 
  font-weight: 500; 
}

.radio-label input[type="radio"] { 
  accent-color: #2566b2; 
  width: 18px; 
  height: 18px; 
}

/* --- モバイル --- */
@media (max-width: 640px) {
  .radio-group {
    flex-direction: column; /* 見出しの下にラベル群 */
    align-items: flex-start;
    gap: 8px;
  }

  .radio-group-text {
    font-size: 1rem;  /* 見出しを小さく */
    padding-right: 0;
  }

  .radio-options {
    flex-wrap: wrap;  /* 横並び維持しつつ狭ければ折返し */
    gap: 12px;
  }

  .radio-label {
    font-size: 0.9rem;
  }
}

/* --- PC/タブレット（既定）: 横並び --- */
.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  width: 100%;
  height: 64px;
}
.search-input {
  height: 100%;
  flex: 1;
  padding: 14px 18px;
  border: 1.5px solid #c5d3e1;
  border-radius: 8px;
  font-size: 1rem;
  background: #f6f8fa;
}
.search-btn {
  height: 100%;
  width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFB000;
  color: #EFF2F6;
  font-weight: bold;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
  user-select: none;
}

/* --- モバイル: 縦2段（入力→ボタン） --- */
@media (max-width: 640px) {
  .search-box {
    flex-direction: column;     /* 縦並び */
    align-items: stretch;       /* 子要素を幅いっぱいに */
    gap: 8px;                   /* モバイルは隙間少し詰める */
    height: auto;               /* 高さは可変 */
  }
  .search-input {
    height: 48px;               /* タップしやすい高さ */
    font-size: 16px;            /* iOSの拡大防止 */
  }
  .search-btn {
    width: 100%;                /* ボタンを横いっぱい */
    height: 48px;               /* 入力と高さを揃える */
    font-size: 16px;
  }
}

.search-btn:hover { background: #FFD366; }
.tablist { display: flex; width: 100%; gap: 0; margin-bottom: 12px; border-bottom: 2.5px solid #e5eaf1; }
.tab { flex: 1; text-align: center; font-size: 1rem; font-weight: 500; padding: 12px 0 11px 0; background: #f8fafc; border-bottom: 2.5px solid transparent; color: #6980a1; cursor: pointer; transition: background .18s, border-color .23s, color .23s; outline: none; user-select: none;}
.tab.active { background: #fff; border-bottom: 2.5px solid #2566b2; color: #2566b2; font-weight: bold; z-index: 1; }
.area-wards { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 6px; width: 100%; }
.ward-btn { padding: 8px 18px; border: 1px solid #2566b2; border-radius: 20px; background: #f8fafc; color: #2566b2; font-size: 0.98rem; font-weight: bold; margin-bottom: 7px; cursor: pointer; transition: background .18s, border-color .18s, color .18s; min-width: 80px; white-space: nowrap; user-select: none; flex-basis: calc(25% - 9px); max-width: calc(25% - 9px); text-align:center;}
.ward-btn.selected { background: #2566b2; color: #fff; border: solid #2566b2; }
.ward-btn.disabled { background: #eaecef; color: #bcc5cf; border: solid #e4e9ef; cursor: not-allowed; opacity: 0.65; pointer-events: none; }
.service-list { display: flex; flex-wrap: wrap; gap: 10px 12px; width: 100%; }
.service-btn { padding: 8px 18px; border-radius: 20px; font-size: 0.98rem; font-weight: bold; border: 1px solid #2566b2; background: #f8fafc; color: #2566b2; cursor: pointer; margin-bottom: 7px; transition: background .18s, border-color .18s, color .18s; white-space: nowrap; user-select: none; min-width: 80px;}
.service-btn.selected { background: #2566b2; color: #fff; border: solid #2566b2; }
.service-btn.disabled { background: #eaecef; color: #bcc5cf; border: solid #e4e9ef; cursor: not-allowed; opacity: 0.65; pointer-events: none; }
.search-footer { display: flex; align-items: center; gap: 36px; margin-top: 26px; width: 100%; justify-content: center; }
.result-count { font-size: 2.1rem; color: #2566b2; font-weight: 700; margin-left: 3px; letter-spacing: -2px; }
.footer-btn {
  padding: 15px 46px;
  background: #CC3366;
  color: #fff;
  font-size: 1.13rem;
  font-weight: bold;
  border-radius: 26px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: background .2s;
  user-select: none;
}

.footer-btn:hover {
  background: #E35C84;
}
.footer-link { color: #2566b2; font-size: 0.99rem; text-decoration: underline; background: none; cursor: pointer; padding: 0; user-select: none;}
.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.6rem;
    color: #2566b2;
    font-weight: 700;
    letter-spacing: -2px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #e1e7f0;
    border-top: 3px solid #2566b2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.searching-disabled {
    pointer-events: none !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.searching-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

/* モバイル対応 */
@media (max-width: 900px) {
  .container {
    padding: 14px 3vw;
    border-radius: 13px;
    min-width: 0;
    max-width: 99vw;
  }
  .section-title-row { font-size:1rem; margin: 10px 0 5px 0;}
  .search-box, .radio-group, .tablist, .area-wards, .service-list, .search-footer { flex-wrap: wrap; gap: 10px 8px;}
  .search-btn, .footer-btn { padding: 10px 20px; font-size:0.7rem;}
  .result-count { font-size: 1.1rem;}
  .radio-label { font-size:0.95rem; }
  .tab { font-size: 0.7rem; }
  .ward-btn, .service-btn { min-width: 60px; font-size:0.7rem; padding: 8px 10px;}
  .search-input { font-size:0.98rem; padding: 10px 12px;}
}
@media (max-width: 600px) {
  .container {
    padding: 4vw 2vw;
    border-radius: 9px;
  }
  .section-title-row { gap: 7px;}
  .section-title-icon { width:22px; height:22px;}
  .section-title-text { font-size:0.98rem; }
}

/* 施設一覧の「サービス」のラベル幅が、包含する文字幅に合うようにするスタイル */
.fit-width-box {
  width: fit-content !important;
  max-width: 100vw;
}

.area-filter-btn {
  width: 100%;
}

/* 以下は、施設一覧のモーダル用のCSS */
.area-modal-open {
  width: 100%;
}

/* モーダル背景 */
.area-modal-bg {
    display: none;
    position: fixed;
    z-index: 998;
    background: rgba(0,0,0,0.3);
}

/* モーダル本体 */
.area-modal {
    display: none;
    position: fixed;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92vw;
    max-width: 720px;
    max-height: 80vh;
    z-index: 999;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ccc;
    box-shadow: 0 4px 16px rgba(0,0,0,0.16);
    padding: 0;
    overflow: hidden;
}

/* ヘッダー */
.area-modal-header {
    padding: 16px;
    border-bottom: 1px solid #ccc;
    text-align: center;
    font-weight: 600;
}

/* リスト部分 */
.area-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px;
}

.area-empty {
    color: #ccc;
}

/* 各自治体ブロック */
.area-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    padding: 8px 0;
    border-bottom: 1px solid #ccc;
}

.area-municipality {
    font-weight: 700;
    margin: 8px 0;
    display: flex;
    justify-content: center;
    width: 10%;
}

/* エリア一覧のグリッド */
.area-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    width: 80%;
}

.area-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* チェックボックスは隠す */
.area-label input[type="checkbox"] {
    display: none;
}

/* タグの見た目 */
.area-label span {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: #f0f0f0;
    color: #333;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* hover時 */
.area-label:hover span {
    background-color: #e6f3ff;
    border-color: #0073aa;
    color: #0073aa;
}

/* 選択状態（チェック時） */
.area-label input[type="checkbox"]:checked + span {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* フッター */
.area-modal-footer {
    border-top: 1px solid #eee;
    background: #f7f9fb;
}

.area-apply-btn {
    width: 100%;
    background: #CC3366;
    color: #FFF;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: unset;
}

/* 閉じるボタン */
.area-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.1rem;
    background: none;
    border: none;
    border-radius: 50%;;
    cursor: pointer;
}

/* ====== おすすめの事業所（変更点あり） ====== */
.nf-cards {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch; /* 行内でカードの高さをそろえる */
}
@media (max-width: 1024px) { .nf-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .nf-cards { grid-template-columns: 1fr; } }

/* ====== Card（ここを縦グリッド化） ====== */
.nf-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto; /* タイトル / 住所 / 評価 / 余白 / ボタン */
  gap: 8px;
  background: #fff7d8;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 0 rgba(0,0,0,.04);
  transition: transform .15s ease, box-shadow .15s ease;
  min-width: 360px;
  min-height: 270px; /* 必要なら維持。不要なら外してもOK */
  color: #505050;
  height: 100%; /* 行の高さにストレッチ */
}
.nf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

/* ====== Title & Address ====== */
.nf-title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;  /* ★2行固定 */
  overflow: hidden;
  align-items: center;
  /* 2行分の高さを確保してカード間で揺れないように */
  min-height: calc(2 * 1.25em); /* 1行=1.25em × 2 */
}

.nf-address {
  margin: 0;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;  /* ★2行固定*/
  overflow: hidden;
  min-height: calc(2 * 1.5em);
}

/* ====== Rating（柔軟小数対応のまま） ====== */
.nf-rating { display: flex; align-items: center; gap: 10px; }
.stars { display: inline-flex; font-size: 24px; color: #ccc; }
.star { position: relative; display: inline-block; color: #ccc; }
.star.is-full { color: #c03a64; }
.star.is-partial::before {
  content: "★";
  position: absolute;
  left: 0; width: var(--percent, 0%); overflow: hidden; color: #c03a64;
}
.star.is-empty { color: #ccc; }
.nf-rating-num { color: #c03a64; font-weight: 700; }

/* ====== Chips (taxonomy tags) ====== */
.nf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nf-chip {
  display: inline-block;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  background: #e9f2ff; 
  color: #1e56b0; border: 1px solid rgba(30,86,176,.12);
  white-space: nowrap;
}

/* ====== CTA Button（最下段スロットに来る） ====== */
.nf-btn{
  display: block; width: 100%; text-align: center;
  padding: 14px 18px; border-radius: 12px;
  background: #1e66d0;
  color: #fff !important;
  font-weight: 800;
  text-decoration: none;
  transition: filter .15s ease, transform .05s ease;
  align-self: stretch;
}

.nf-btn:hover { filter: brightness(1.05); }
.nf-btn:active { transform: translateY(1px); }

/* ====== Utilities ====== */
.nf-card .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}