/* =============================================================
   富士企画 refit版 — レスポンシブ追加レイヤー
   元style.cssは1ピクセルもいじらない。ここで上書きのみ。

   PC（1021px超）: 元サイト完全踏襲（モバイルUI隠す）
   タブレット（768〜1020px）: 1カラム化
   スマホ（767px以下）: コンパクトUI + Sticky CTA + ドロワー
   ============================================================= */

/* ---------- 共通 ---------- */
img { max-width: 100%; height: auto; }
html, body { overflow-x: hidden; }

/* ---------- body背景: TOP/後続ページ統一 ---------- */
body {
  background: #f6f8f6 !important;
  background-image: none !important;
}

/* ---------- 後続ページ固定幅要素のレスポンシブ化（SP右端見切れ対策） ---------- */
@media (max-width: 1020px) {
  #main .stepH3CoBg,
  #main .stepCoBg,
  #main .mapCoBg,
  #main .photoCo,
  #main .flowCo,
  #main .co {
    width: auto !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box;
  }
  #main img { max-width: 100% !important; height: auto !important; }
  #main iframe { max-width: 100% !important; }
  #main table {
    max-width: 100% !important;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- .pageTop（ページのトップへ）右端配置・width強制せず main内で右寄せ ---------- */
.pageTop {
  clear: both !important;
  margin: 24px 0 8px !important;
  padding: 0 !important;
}
.pageTop p {
  text-align: right !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  font-size: 13px;
}
.pageTop p a {
  color: #2c5e33;
  text-decoration: none;
  font-weight: 600;
}
.pageTop p a::before {
  content: "▲ ";
  font-size: 11px;
}
.pageTop p a:hover { color: #51E565; }
#wrapper { background: transparent !important; }
/* メインコンテンツ領域に白いカード感 */
#container {
  background: #fff;
  box-shadow: 0 0 0 1px #e8eee8;
}

/* ============================================================
   トップバー 100%幅化（背景のみフル幅・中身は1200pxに制限）
   ヘッダー全体もセンター配置
   ============================================================ */
#hdr {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
}
/* PC: ロゴ＋電話の header2 / 6ボタンナビ / スライダー / コンテナ全部センター配置 */
@media (min-width: 1021px) {
  /* 元1040pxレイアウトを維持してセンター配置 */
  #header2 {
    width: 1040px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    background-position: 5px 5px !important;
  }
  ul#topnav {
    max-width: 1040px !important;
    margin: 15px auto !important;
  }
  /* 6ボタンナビ（#hdr直下のhdrBtn）も元の910pxに合わせてセンター配置 */
  #hdr > ul.hdrBtn {
    max-width: 1040px !important;
    margin: 8px auto !important;
    display: flex !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 0 !important;
    box-sizing: border-box;
    list-style: none;
  }
  #hdr > ul.hdrBtn li {
    float: none !important;
    margin: 0 !important;
    list-style: none;
  }
  #hdr > ul.hdrBtn li img { display: block; }
  #sliderCo2 {
    max-width: 1040px !important;
    margin: 0 auto !important;
  }
  /* コンテナは元の1020pxレイアウト維持（sidebar 230 + main 760 のバランス） */
  #container {
    width: 1020px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  /* PC: 2カラム構造を明示復帰（#main float:right / #sidebar float:left） */
  #main {
    float: right !important;
    width: 760px !important;
    margin: 0 10px 0 0 !important;
    padding: 0 !important;
    display: inline !important;
    background: #fff;
  }
  #sidebar {
    float: left !important;
    width: 230px !important;
    clear: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }
  #container::after {
    content: "";
    display: block;
    clear: both;
  }
}
#header {
  background: #2c5e33 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 6px 0 !important;
  color: #fff !important;
  position: relative;
}
#header h1 {
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 200px 0 20px !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  color: #fff !important;
  line-height: 1.5 !important;
  letter-spacing: 0;
  box-sizing: border-box !important;
}
#header h1 span { display: inline !important; }
#header #headerlink_right {
  position: absolute !important;
  top: 50% !important;
  right: max(20px, calc((100% - 1200px) / 2 + 20px)) !important;
  transform: translateY(-50%);
  margin: 0 !important;
  padding: 0 !important;
}
#header #headerlink_right li {
  float: none !important;
  display: inline-block !important;
  margin: 0 8px !important;
  font-size: 11px !important;
}
#header #headerlink_right li a,
#header #headerlink_right li a:hover { color: #fff !important; }
#header #headerlink_right img { filter: brightness(2); opacity: .8; }

/* ============================================================
   ブログ記事ページ 今風化
   ============================================================ */
body.single #main,
#main #date,
#main h2 + #date {
  /* マッチを保証 */
}
#main #date {
  text-align: left !important;
  padding: 4px 0 !important;
  font-weight: 400 !important;
  color: #999 !important;
  font-size: 12px !important;
  letter-spacing: .06em;
  background: transparent !important;
  border: none !important;
  margin: 4px 0 16px !important;
}
#main #date::before {
  content: "📅 ";
  font-size: 11px;
  margin-right: 2px;
  opacity: .6;
}
/* 記事本文の段落をリーダブルに */
#main > p,
#main h2 ~ p {
  max-width: 720px;
  font-size: 15px !important;
  line-height: 2 !important;
  color: #333;
  padding: 0 4px 4px !important;
}
#main h2 ~ p:has(img),
#main p img {
  max-width: 100%;
}
#main p img {
  display: block;
  margin: 16px auto !important;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  max-height: 480px;
  width: auto;
}
/* 記事下部のナビ（前後リンク等） */
#main #next {
  border-top: 1px solid #e0ebe0;
  margin-top: 40px !important;
  padding-top: 20px !important;
}

/* ============================================================
   100の夢ビジュアライゼーション
   ============================================================ */
.bucket-viz {
  background: linear-gradient(180deg, #fff 0%, #f7fdf7 100%);
  border: 1px solid #e0ebe0;
  border-radius: 12px;
  padding: 20px 16px;
  margin: 16px 0 32px;
  max-width: none;
}
.bucket-viz-head { text-align: center; margin-bottom: 16px; }
.bucket-viz-title {
  font-size: 18px;
  font-weight: 700;
  color: #2c5e33;
  margin: 0;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  line-height: 1.3;
}
.bucket-viz-title::before { content: "🎯 "; }
.bucket-viz-sub {
  font-size: 11px;
  color: #888;
  margin: 4px 0 0;
  padding: 0 !important;
}
.bucket-viz-stats {
  text-align: center;
  margin: 8px auto 16px;
}
.bucket-viz-stat-num {
  font-size: 36px;
  font-weight: 700;
  color: #51E565;
  line-height: 1;
  font-family: Georgia, serif;
  letter-spacing: .02em;
}
.bucket-viz-stat-num small {
  font-size: 16px;
  color: #888;
  font-weight: 400;
  margin-left: 4px;
}
.bucket-viz-stat-label {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}
.bucket-viz-donut {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8f0e8;
}
.bucket-donut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto;
  position: relative;
}
.bucket-donut::after {
  content: "";
  position: absolute;
  inset: 22%;
  background: #fff;
  border-radius: 50%;
}
.bucket-legend {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 11px;
}
.bucket-legend li {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  color: #333;
}
.bucket-legend li em {
  margin-left: auto;
  color: #888;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
}
.bv-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bucket-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin: 0 auto 16px;
  max-width: 480px;
}
.bv-cell {
  aspect-ratio: 1;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: Georgia, serif;
  transition: transform .1s, box-shadow .1s, opacity .15s;
  opacity: .85;
  position: relative;
}
.bv-cell:hover { opacity: 1; transform: scale(1.1); z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.bv-cell.is-done {
  opacity: 1;
}
.bv-cell.is-done::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.4);
  border-radius: 4px;
  font-size: 14px;
  color: #fff;
  font-weight: 700;
}

.bucket-detail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border-left: 4px solid #51E565;
  border-radius: 4px;
  padding: 12px 14px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.bv-detail-num {
  flex-shrink: 0;
  background: #1a1a1a;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 700;
}
.bv-detail-text {
  color: #333;
  word-break: break-word;
}
@media (max-width: 600px) {
  .bucket-viz-donut { grid-template-columns: 110px 1fr; gap: 12px; }
  .bucket-donut { width: 100px; height: 100px; }
  .bucket-legend { font-size: 10px; grid-template-columns: 1fr 1fr; gap: 3px 6px; }
  .bucket-grid { gap: 3px; max-width: 100%; }
  .bv-cell { font-size: 10px; }
}

/* ============================================================
   フッター モダン化（PC/SP共通・淡いグリーン地）
   ============================================================ */
#footer {
  background: #f3faf3 !important;
  background-image: none !important;
  min-width: 0 !important;
  height: auto !important;
  color: #222 !important;
  border-top: 4px solid #51E565;
  padding: 32px 0 0 !important;
  position: relative;
}
#footer .inner {
  background: transparent !important;
  background-image: none !important;
  width: 100% !important;
  max-width: 1040px !important;
  height: auto !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 32px !important;
  padding: 24px 20px !important;
  margin: 0 auto !important;
  align-items: start;
  justify-items: center;
  overflow: visible !important;
  position: relative;
}
#footer #logo,
#footer #gaiyou,
#footer #box_wrapper,
#footer .refit-footer-nav { width: 100%; max-width: 300px; }
#footer #box_wrapper {
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}
#footer #gaiyou {
  display: block !important;
}
#footer #logo {
  float: none !important;
  margin: 0 !important;
  width: auto !important;
  padding: 0 !important;
  display: contents;        /* 子要素をgridアイテムにする */
}
#footer #logo > a { display: none; }
#footer #logo > img { display: none; }
/* 会社名カラム（::before の代わりに独立要素）*/
#footer #gaiyou::before {
  content: "富士企画株式会社";
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #1a4520;
  margin-bottom: 16px;
  letter-spacing: .04em;
}
#footer #gaiyou {
  width: auto !important;
  padding: 0 !important;
  font-size: 13px !important;
  line-height: 1.8 !important;
  color: #222 !important;
  text-align: left !important;
}
#footer #gaiyou a { color: #2c5e33 !important; text-decoration: underline; }
#footer #gaiyou a:hover { color: #1a4520 !important; }
.refit-gaiyou-dl {
  margin: 0 !important;
  padding: 0;
  display: grid !important;
  grid-template-columns: 100px 1fr;
  gap: 6px 16px;
  text-align: left;
  max-width: none !important;
}
.refit-gaiyou-dl dt {
  font-weight: 600 !important;
  color: #2c5e33 !important;
  font-size: 12px !important;
  padding: 4px 0 !important;
  border-right: 1px solid #d6e5d6 !important;
  padding-right: 12px !important;
  letter-spacing: .04em;
  display: flex !important;
  align-items: center;
  gap: 6px;
}
.refit-fi {
  flex-shrink: 0;
  color: #51E565;
  vertical-align: middle;
}

/* フッターナビ */
.refit-footer-nav { padding: 0; }
.refit-footer-nav h4 {
  font-size: 12px;
  color: #2c5e33;
  margin: 0 0 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid #d6e5d6;
  letter-spacing: .04em;
  font-weight: 600;
}
.refit-footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}
.refit-footer-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.refit-footer-nav li a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #222 !important;
  text-decoration: none !important;
  padding: 4px 0;
  transition: color .15s;
}
.refit-footer-nav li a::before {
  content: "›";
  color: #51E565;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.refit-footer-nav li a:hover {
  color: #2c5e33 !important;
  text-decoration: underline !important;
}
.refit-gaiyou-dl dd {
  margin: 0 !important;
  padding: 4px 0 !important;
  font-size: 13px !important;
  color: #222 !important;
  line-height: 1.55;
  word-break: break-word;
}
.refit-gaiyou-dl dd a {
  color: #2c5e33 !important;
  text-decoration: underline;
}
.refit-gaiyou-dl dd .note {
  display: block;
  font-size: 10px;
  color: #888 !important;
  margin-top: 2px;
}
#footer #ftrLn,
#footer #box_wrapper {
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
}
#footer #ftrLn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}
#footer #ftrLn li {
  float: none !important;
  font-size: 12px !important;
  list-style: none;
}
#footer #ftrLn span { display: none !important; }
#footer #ftrLn a {
  color: #2c5e33 !important;
  text-decoration: none;
}
#footer #ftrLn a:hover { color: #1a4520 !important; text-decoration: underline; }
#footer::after {
  content: "© www.fuji-plan.net all rights reserved.";
  display: block;
  text-align: center;
  font-size: 11px;
  color: #888;
  padding: 16px 8px;
  border-top: 1px solid #d6e5d6;
  margin-top: 16px;
  background: transparent;
}
@media (max-width: 768px) {
  #footer .inner {
    grid-template-columns: 1fr !important;
    gap: 20px;
    padding: 20px 16px !important;
  }
  #footer #gaiyou {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  #footer #logo::before {
    text-align: center;
    font-size: 18px;
  }
  .refit-gaiyou-dl {
    grid-template-columns: 100px 1fr !important;
    max-width: 360px;
    margin-inline: auto !important;
  }
  .refit-footer-nav {
    max-width: 360px;
    margin-inline: auto;
  }
  .refit-footer-nav ul { grid-template-columns: 1fr 1fr; }
  #footer #ftrLn { justify-content: center; }
}

/* ============================================================
   見出し refresh: 古い heading.png 背景を完全置換（PC/SP共通）
   - 雰囲気保持: ダーク緑背景・白文字・左に緑アクセント
   - 余計な角度・斜め・葉アイコン廃止
   ============================================================ */
#main h2 {
  margin: 24px 0 16px !important;
  padding: 14px 18px !important;
  line-height: 1.4 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #fff !important;
  background: #51E565 !important;
  border-left: 5px solid #2c5e33 !important;
  border-radius: 2px;
  letter-spacing: .04em;
  box-shadow: none;
}
#sidebar h3 {
  background: #51E565 !important;
}
#main h3 {
  background: none !important;
  padding: 8px 0 8px 14px !important;
  border-left: 4px solid #51E565;
  border-bottom: 1px solid #e0ebe0;
  font-size: 16px !important;
  line-height: 1.5 !important;
  margin: 20px 0 12px !important;
  color: #1a4520 !important;
  letter-spacing: 0;
}
#main h4 {
  background: none !important;
  padding: 6px 0 6px 12px !important;
  border-left: 3px solid #51E565;
  font-size: 15px !important;
  line-height: 1.5 !important;
  margin: 16px 0 10px !important;
  color: #1a4520 !important;
  letter-spacing: 0;
}
/* サイドバー見出しも同テイストに */
#sidebar h3 {
  background: #51E565 !important;
  background-image: none !important;
  color: #fff !important;
  padding: 10px 14px !important;
  margin-top: 0 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  letter-spacing: .04em;
  border-radius: 2px;
}

/* ============================================================
   INFORMATION（投稿一覧）リファイン
   ============================================================ */
#main h2:not(.refit-melmag-head h2) {
  /* セクションタイトルをモダンに */
}
.ttCos { padding: 0 !important; }
.ttCo {
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow .15s, transform .15s;
}
.ttCo:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.ttCo h3 {
  margin: 0 0 8px !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}
.ttCo h3 a {
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 700;
}
.ttCo h3 a:hover { color: #2c5e33; text-decoration: none; }
.ttCo dl { margin: 0; padding: 0; }
.ttCo dt {
  font-size: 15px;
  color: #2c5e33;
  font-weight: 700;
  margin: 0 0 10px !important;       /* 元CSS margin-left:115px を解除 */
  padding: 0 !important;
  letter-spacing: .04em;
}
.ttCo dd { margin: 0; padding: 0; overflow: hidden; }
.ttCo dd img.alignleft {
  float: left;
  width: 80px !important;
  height: 80px !important;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 14px 8px 0 !important;
  padding: 0 !important;
}
.ttCo dd p {
  margin: 0 0 8px !important;
  padding: 0 !important;
  font-size: 13px;
  line-height: 1.7;
  color: #333;
}
.ttCo dd p a {
  display: inline-block;
  color: #2c5e33;
  font-size: 12px;
  text-decoration: none;
  font-weight: 600;
  padding: 4px 0;
  margin-top: 4px;
  border-bottom: 1px solid currentColor;
}
.ttCo dd p a:hover { color: #1a4520; }

/* 過去のINFORMATIONボタン */
.hInfoBtn { text-align: center; margin: 20px 0; padding: 0 !important; }
.hInfoBtn img { max-width: 280px; }

/* ============================================================
   メルマガ登録セクション（コンパクト）
   ============================================================ */
.refit-melmag {
  background: #fff;
  padding: 4px 0 8px;
  margin: 8px 0;
}
.refit-melmag-head { text-align: center; margin-bottom: 8px; }
.refit-melmag-head h2 {
  font-size: 22px;
  color: #2c5e33;
  margin: 0 0 4px;
  padding: 0;
  background: none;
  border: none;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .02em;
}
.refit-melmag-head h2::before {
  content: "✉";
  display: inline-block;
  margin-right: 8px;
  color: #51E565;
}
.refit-melmag-lead {
  font-size: 13px;
  color: #444;
  margin: 0;
  line-height: 1.5;
  padding: 0;
}
.refit-melmag-lead strong {
  color: #D80001;
  font-weight: 700;
}
.refit-melmag-benefits {
  list-style: none;
  margin: 0 auto 8px;
  padding: 8px 0 4px;
  border-top: 1px dashed #b6d8b9;
  border-bottom: 1px dashed #b6d8b9;
  max-width: 460px;
}
.refit-melmag-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #1a4520;
  padding: 2px 4px;
  font-weight: 500;
  line-height: 1.4;
}
.refit-melmag-benefits li span {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: #51E565;
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.refit-melmag-cta {
  text-align: center;
  font-size: 12px;
  color: #2c5e33;
  margin: 0 0 8px;
  font-weight: 600;
}

/* スライダーラッパー: 元CSSの固定1080px幅をフルードに */
#sliderCo2 {
  width: 100% !important;
  max-width: 1080px;
  margin: 0 auto;
}
/* スライダー画像のwidth属性無効化 */
.meteor-slides img { width: 100% !important; height: auto !important; max-width: 100%; }
.attachment-featured-slide { width: 100% !important; height: auto !important; }

/* PC: モバイル専用UI完全に隠す */
#refit-mobile-header,
#refit-mobile-subbar,
#refit-sticky-cta,
#refit-hamburger,
#refit-drawer {
  display: none;
}
/* PCではメルマガリデザイン版を非表示にして元のh2構造を尊重(差替済HTMLでも普通に表示OK) */

/* ---------- スライダー: jQuery cycle代替 (CSS keyframes 4枚自動切替) ---------- */
.meteor-slides {
  position: relative;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  aspect-ratio: 1080 / 400;
  overflow: hidden;
  background: #f3f3f3;
}
.meteor-slides .meteor-clip { position: relative; width: 100%; height: 100%; }
.meteor-slides .meteor-shim { display: none; }
.meteor-slides .mslide {
  display: block !important;
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  animation: refit-cycle 20s infinite;
}
.meteor-slides .mslide a,
.meteor-slides .mslide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.meteor-slides .mslide-1 { animation-delay: 0s; }
.meteor-slides .mslide-2 { animation-delay: 5s; }
.meteor-slides .mslide-3 { animation-delay: 10s; }
.meteor-slides .mslide-4 { animation-delay: 15s; }
@keyframes refit-cycle {
  0%, 22%  { opacity: 1; z-index: 2; }
  25%, 97% { opacity: 0; z-index: 1; }
  100%     { opacity: 1; z-index: 2; }
}
.meteor-slides .meteor-nav,
.meteor-slides .meteor-buttons { display: none; }

/* PC: hdrLogo は背景画像に含まれているため非表示 */
@media (min-width: 1021px) {
  #header2 #hdrLogo { display: none; }
}

/* =============================================================
   タブレット 1020px以下: 縦並び化
   ============================================================= */
@media (max-width: 1020px) {
  #container { width: 100% !important; max-width: 100%; padding: 0 12px; box-sizing: border-box; overflow-x: hidden; }
  #hdr { width: 100% !important; max-width: 100%; padding: 0 12px; box-sizing: border-box; }
  body { background-image: none; background-color: #f6f6f6; }

  /* PCヘッダー（hdr/header2/topnav）はモバイルでは非表示にし、コンパクト版で代替 */
  #header2 {
    height: auto !important;
    background: #fff !important;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }
  #header2 #hdrLogo { float: none !important; margin: 0 !important; width: auto !important; max-width: 220px; }
  #header2 #hdrSoudan { position: static !important; }
  #header2 #hdrLink { position: static !important; text-indent: 0 !important; }
  #header2 #hdrLink a { width: auto !important; height: auto !important; display: inline-block !important; }
  #header2 #header_btn { float: none !important; width: 100% !important; height: auto !important; margin: 8px 0 0 !important; }
  #header2 #header_btn ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 !important; padding: 0; list-style: none; }
  #header2 #header_btn li { float: none !important; margin: 0 !important; }
  #header2 #header_btn img { max-width: 100%; height: auto; }

  ul#topnav { width: auto !important; height: auto !important; background: none !important; margin: 8px 0; display: flex; flex-wrap: wrap; justify-content: center; }
  ul#topnav li { float: none !important; width: auto !important; }
  ul#topnav a { width: 130px !important; height: 46px !important; }

  /* メイン2カラム → 縦並び */
  #main { float: none !important; width: 100% !important; max-width: 100%; margin: 0 !important; padding: 0; box-sizing: border-box; }
  #sidebar { float: none !important; width: 100% !important; max-width: 100%; padding: 16px 0 !important; box-sizing: border-box; }
  #sidebar h3 { background-position: 0 50% !important; }

  #main #osirase, #main #osirase2 { float: none !important; width: 100% !important; }
  #main #osirase ul, #main #osirase2 ul { width: auto !important; }

  /* フッター */
  #footer { min-width: 0 !important; height: auto !important; padding-bottom: 24px; background-size: auto 100%; }
  #footer .inner { width: 100% !important; max-width: 100%; height: auto !important; padding: 16px 12px !important; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 16px; }
  #footer #logo { float: none !important; margin: 0 !important; width: auto !important; max-width: 292px; }
  #footer #gaiyou { width: 100% !important; max-width: 600px; text-align: center; }
  #ftrLn { position: static !important; text-align: center; padding: 8px 0; }
  #ftrLn li { float: none !important; display: inline-block; margin: 0 8px; }

  .meteor-slides, #meteor-slideshow, .mslide { max-width: 100%; height: auto !important; }
}

/* =============================================================
   スマホ 767px以下: フル最適化
   ============================================================= */
@media (max-width: 767px) {
  body {
    padding-top: 122px;      /* ヘッダー60px + サブバー62px */
    padding-bottom: 60px;    /* Sticky CTA */
    -webkit-text-size-adjust: 100%;
  }

  /* PCヘッダー全体を隠してモバイル専用UIに切り替え */
  #hdr,
  #header,
  ul#topnav-pc { display: none; }

  /* PCのheader2内ロゴ・電話・問い合わせ系は非表示（モバイルヘッダーで代替） */
  #header2 #hdrLogo,
  #header2 #hdrSoudan,
  #header2 #hdrLink { display: none; }

  /* header2 の主要ボタン（HOME/特徴等）はそのまま表示 */
  #header2 {
    padding: 8px 0 !important;
    background: #fff !important;
    margin-top: 0;
  }
  #header2 #header_btn ul {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
    padding: 8px !important;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  #header2 #header_btn li {
    width: 100% !important;
    margin: 0 !important;
    list-style: none;
  }
  #header2 #header_btn li a { display: block; width: 100%; }
  #header2 #header_btn img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 44px;
    object-fit: contain;
    display: block;
  }

  /* ============ サイドバー長尺バナー: 2列グリッド ============ */
  #sidebar > p,
  #sidebar > div.bnr,
  #sidebar > a,
  #sidebar .keikeishaBnr,
  #sidebar .indexLikeBtn,
  #sidebar .kaiinBukkenLBtn,
  #sidebar .inqLBtn { width: auto; }
  #sidebar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 8px !important;
  }
  #sidebar > * { margin: 0 !important; }
  #sidebar > h3 { grid-column: 1 / -1; }
  #sidebar img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
  }

  /* ============ 全 ul.hdrBtn を2列グリッド化 ============
     - #header2内: HOME/特徴等の6ボタン → 2x3
     - #main直下: 売りたい/買いたい/相談/承継の4カード → 2x2
     ============================================================ */
  ul.hdrBtn {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 8px 0 !important;
    padding: 8px !important;
    list-style: none;
    box-sizing: border-box;
  }
  ul.hdrBtn li {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    list-style: none;
    padding: 0 !important;
  }
  ul.hdrBtn li a {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  ul.hdrBtn li img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    display: block;
    object-fit: contain;
  }

  /* ============ kaniインラインフォーム（シンプル無地） ============ */
  .refit-kani-inline {
    margin: 0 auto 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    max-width: 560px;
    box-shadow: none;
  }
  .refit-kani-inline table.inqTb {
    width: 100% !important;
    border-collapse: collapse;
    border: none !important;
  }
  .refit-kani-inline table.inqTb tbody { display: block; }
  .refit-kani-inline table.inqTb tr {
    display: block;
    margin-bottom: 12px;
    border: none !important;
  }
  .refit-kani-inline table.inqTb th,
  .refit-kani-inline table.inqTb td {
    display: block;
    width: 100% !important;
    padding: 0 !important;
    text-align: left;
    border: none !important;
    background: transparent !important;
    box-sizing: border-box;
  }
  .refit-kani-inline table.inqTb th {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    letter-spacing: .04em;
    display: flex !important;
    align-items: center;
    gap: 8px;
  }
  .refit-kani-inline .hissuIcon {
    background: #D80001;
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 2px;
    font-weight: 600;
    line-height: 1.5;
  }
  /* 入力欄: 下線のみ（Material風・枠なし） */
  .refit-kani-inline input[type="text"],
  .refit-kani-inline input[name="_mail"],
  .refit-kani-inline input[name="_name"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 8px 0 !important;
    border: none !important;
    border-bottom: 1px solid #999 !important;
    border-radius: 0 !important;
    font-size: 16px !important;
    background: transparent !important;
    outline: none !important;
    transition: border-color .2s;
  }
  .refit-kani-inline input:focus {
    border-bottom-color: #51E565 !important;
    border-bottom-width: 2px !important;
    padding-bottom: 7px !important;
  }
  .refit-kani-inline input::placeholder { color: #aaa; }
  .refit-kani-inline .hankaku2 {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
  }
  .refit-kani-inline .kakuninBtn {
    text-align: center;
    margin: 20px 0 0;
    padding: 0 !important;
  }
  .refit-kani-inline .kakuninBtn input[type="submit"] {
    background: #51E565 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 32px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    border-radius: 0 !important;
    cursor: pointer;
    width: auto !important;
    min-width: 200px;
  }

  /* ============ フッター会社情報 dl 整形 ============ */
  .refit-gaiyou-dl {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px 14px;
    text-align: left;
    max-width: 320px;
    margin-inline: auto;
  }
  .refit-gaiyou-dl dt {
    font-weight: 700;
    color: #2c5e33;
    font-size: 12px;
    padding: 4px 0;
    border-right: 1px solid #d6e5d6;
    padding-right: 8px;
  }
  .refit-gaiyou-dl dd {
    margin: 0;
    padding: 4px 0;
    font-size: 13px;
    color: #222;
    line-height: 1.55;
    word-break: break-word;
  }
  .refit-gaiyou-dl dd a {
    color: #2c5e33;
    text-decoration: underline;
  }
  .refit-gaiyou-dl dd .note {
    display: block;
    font-size: 10px;
    color: #888;
    margin-top: 2px;
  }

  /* ============ ヘッダー（社名のみ・左寄せ） ============ */
  #refit-mobile-header {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    z-index: 9990;
    padding: 0 12px;
    box-sizing: border-box;
  }
  #refit-mobile-header .refit-mh-logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #1a1a1a;
    flex: 1;
    min-width: 0;
    justify-content: center;
    line-height: 1.2;
  }
  #refit-mobile-header .refit-mh-name {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #refit-mobile-header .refit-mh-tagline {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* 下段: 電話番号バー */
  #refit-mobile-subbar {
    display: block;
    position: fixed;
    top: 60px; left: 0; right: 0;
    height: 62px;
    background: #fff5f5;
    border-bottom: 1px solid #f3dada;
    z-index: 9989;
    padding: 0;
    box-sizing: border-box;
  }
  #refit-mobile-subbar .refit-sb-tel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: #222;
    line-height: 1.2;
    padding: 6px 8px;
    box-sizing: border-box;
  }
  #refit-mobile-subbar .refit-sb-tel-label {
    font-size: 10px;
    color: #555;
    letter-spacing: .04em;
  }
  #refit-mobile-subbar .refit-sb-tel-num {
    font-size: 24px;
    font-weight: 700;
    color: #D80001;
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: .02em;
    margin: 1px 0;
    line-height: 1;
  }
  #refit-mobile-subbar .refit-sb-tel-hours {
    font-size: 10px;
    color: #777;
  }

  /* ============ ハンバーガーボタン（最小限） ============ */
  #refit-hamburger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    gap: 5px;
  }
  #refit-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    transition: transform .2s, opacity .2s;
  }
  body.refit-nav-open #refit-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.refit-nav-open #refit-hamburger span:nth-child(2) { opacity: 0; }
  body.refit-nav-open #refit-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ============ ドロワーメニュー ============ */
  #refit-drawer {
    display: block;
    position: fixed;
    top: 60px;
    right: -100%;
    width: 82%;
    max-width: 340px;
    height: calc(100vh - 60px);
    background: #fff;
    z-index: 9985;
    overflow-y: auto;
    padding: 0 0 96px;
    box-sizing: border-box;
    box-shadow: -4px 0 16px rgba(0,0,0,.2);
    transition: right .3s;
  }
  body.refit-nav-open #refit-drawer { right: 0; }
  #refit-drawer h3 {
    margin: 0;
    padding: 8px 16px;
    font-size: 11px;
    color: #888;
    background: #fafafa;
    letter-spacing: .08em;
    font-weight: 600;
    border-bottom: 1px solid #eee;
  }
  #refit-drawer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #f0f0f0;
  }
  #refit-drawer li {
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
  }
  #refit-drawer li:nth-child(2n) { border-right: none; }
  #refit-drawer li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: #222;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background .15s;
    min-height: auto;
    line-height: 1.3;
  }
  #refit-drawer li a::after {
    content: "›";
    color: #ccc;
    font-size: 14px;
    font-weight: 300;
  }
  /* TELボタンは2列横断 */
  #refit-drawer li.phone {
    grid-column: 1 / -1;
    border-right: none;
  }
  #refit-drawer li a:hover,
  #refit-drawer li a:active { background: #f7f7f7; }
  #refit-drawer li.phone {
    background: #fafafa;
    margin-top: 8px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
  }
  #refit-drawer li.phone a {
    color: #D80001;
    font-size: 15px;
    font-weight: 700;
    font-family: Georgia, serif;
    justify-content: center;
    padding: 12px 16px;
    letter-spacing: .02em;
    min-height: auto;
  }
  #refit-drawer li.phone a::after { display: none; }
  #refit-drawer li.phone a::before {
    content: "TEL";
    background: #D80001;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    margin-right: 8px;
    font-family: sans-serif;
    border-radius: 2px;
    font-weight: 600;
    letter-spacing: .04em;
  }

  /* オーバーレイ */
  body.refit-nav-open::after {
    content: "";
    position: fixed;
    inset: 60px 0 0 0;
    background: rgba(0,0,0,.5);
    z-index: 9980;
  }

  /* ============ Sticky CTA（白背景・アクセント線・ミニマル） ============ */
  #refit-sticky-cta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    z-index: 9988;
    background: #fff;
    border-top: 1px solid #e0e0e0;
  }
  #refit-sticky-cta a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    gap: 4px;
    line-height: 1;
    color: #333;
    transition: background .15s;
    position: relative;
  }
  #refit-sticky-cta a:active { background: #f7f7f7; }
  #refit-sticky-cta .cta-icon { font-size: 18px; line-height: 1; opacity: .85; }
  #refit-sticky-cta .cta-label { font-size: 12px; letter-spacing: .04em; }
  /* アクセント線（上部） */
  #refit-sticky-cta a::before {
    content: "";
    position: absolute;
    top: 0; left: 8px; right: 8px;
    height: 2px;
  }
  #refit-sticky-cta .cta-tel::before    { background: #D80001; }
  #refit-sticky-cta .cta-mendan::before { background: #51E565; }
  #refit-sticky-cta .cta-mail::before   { background: #2c5e33; }
  #refit-sticky-cta .cta-tel    .cta-label { color: #D80001; }
  #refit-sticky-cta .cta-mendan .cta-label { color: #2c7d33; }
  #refit-sticky-cta .cta-mail   .cta-label { color: #2c5e33; }

  /* ============ スライダーの高さ制限（SPはコンパクトに） ============ */
  .meteor-slides {
    aspect-ratio: 21 / 9;
    max-height: 180px;
  }
  #sliderCo2 { padding: 8px 0 !important; }

  /* ============ コンテンツ余白詰め ============ */
  #container { padding: 0 8px !important; }
  #main h2 { font-size: 16px !important; line-height: 1.4 !important; padding: 8px 12px !important; background-size: cover !important; }
  #main p { padding: 5px 8px 12px 0 !important; }
  #main p.withImage { width: auto !important; }
  #main p.withImage img { float: none !important; display: block; margin: 8px auto !important; }
  #main .bannerM img { padding: 4px !important; }

  /* ============ サイドバー → カード型グリッド ============ */
  #sidebar { padding: 16px 0 !important; }
  #sidebar > p,
  #sidebar > div {
    margin-bottom: 12px !important;
    text-align: center;
  }
  #sidebar img {
    max-width: 320px;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
  }

  /* ============ iframeレスポンシブ ============ */
  iframe {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* ============ フォーム iOS最適化 ============ */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  textarea,
  select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    font-size: 16px !important;  /* iOSズーム防止 */
    padding: 12px !important;
    border: 1px solid #ccc;
    border-radius: 4px;
    -webkit-appearance: none;
  }
  button,
  input[type="submit"],
  input[type="button"] {
    min-height: 48px;
    font-size: 16px !important;
    padding: 12px 24px !important;
  }

  /* ============ フッター詰め＋背景ソフト化 ============ */
  #footer {
    height: auto !important;
    padding: 24px 0 16px !important;
    background: #f3faf3 !important;       /* 緑背景画像→淡いグリーン地 */
    background-image: none !important;
    border-top: 4px solid #51E565;
    color: #222 !important;
    position: relative;
  }
  #footer::after {
    content: "© www.fuji-plan.net all rights reserved.";
    display: block;
    text-align: center;
    font-size: 10px;
    color: #888;
    margin-top: 16px;
    padding: 12px 8px 4px;
    border-top: 1px solid #d6e5d6;
    word-break: break-word;
  }
  #footer .inner {
    padding: 16px 12px !important;
    gap: 14px !important;
    background: transparent !important;
  }
  /* footer_logo.pngは元々ダーク背景前提で透過/薄色のため非表示。会社名テキストで代替 */
  #footer #logo img { display: none; }
  #footer #logo::before {
    content: "富士企画株式会社";
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #2c5e33;
    text-align: center;
    padding: 8px 0;
  }
  #footer #gaiyou {
    font-size: 12px !important;
    line-height: 1.7 !important;
    color: #222 !important;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
    padding: 0 8px;
  }
  #footer #gaiyou a { color: #2c5e33 !important; text-decoration: underline; }
  #ftrLn { padding: 8px 0 !important; }
  #ftrLn li {
    display: inline-block !important;
    margin: 4px 6px !important;
    font-size: 12px !important;
  }
  #ftrLn span { display: none; } /* セパレータ「|」非表示 */
  #ftrLn a { color: #2c5e33 !important; }
  #ftrTxt {
    font-size: 11px !important;
    color: #555 !important;
    line-height: 1.5 !important;
    padding: 8px 12px !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: center;
  }

  /* ============ スクロール改善 ============ */
  body.refit-nav-open { overflow: hidden; }

  /* ============ タップターゲット拡大（ドロワー内は除外） ============ */
  a, button { min-height: 44px; }
  #refit-drawer a { min-height: 0 !important; }
  #footer a, #ftrLn a { min-height: 32px; display: inline-block; padding: 6px 0; }
}

/* =============================================================
   小スマホ 480px以下: さらに詰める
   ============================================================= */
@media (max-width: 480px) {
  body { font-size: 14px; }
  #refit-mobile-header .refit-mh-tel .num { font-size: 12px; }
  #refit-mobile-header .refit-mh-logo img { max-height: 38px; }
  #main h3, #main h4 { font-size: 15px !important; }
  #refit-sticky-cta .lbl { font-size: 11px; }
  #refit-sticky-cta .ico { font-size: 20px; }
}

/* =============================================================
   超小スマホ 360px以下: 最終調整
   ============================================================= */
@media (max-width: 360px) {
  #refit-mobile-header .refit-mh-tel .num { display: none; }
  #refit-mobile-header .refit-mh-tel { padding: 8px; }
  #refit-mobile-header .refit-mh-tel .ico { font-size: 18px; }
}

/* =============================================================
   横向き対応（landscape小）
   ============================================================= */
@media (max-width: 920px) and (orientation: landscape) and (max-height: 500px) {
  body { padding-bottom: 56px; }
  #refit-sticky-cta { height: 52px; }
  #refit-sticky-cta .ico { font-size: 18px; }
  #refit-sticky-cta .lbl { font-size: 10px; }
}
