/* ========== ヘッダー行：右に検索を寄せて狭幅で表示 ========== */

/* ヘッダー上段を横並び（都庁リンクの右に検索を配置） */
.fnc_wrap .fnc_top{
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;   /* ULの余白/黒丸を消す */
  padding: 0;
  margin: 0;
}
/* 検索コンテナ（右側へ寄せる微調整） */
.fnc_wrap .fnc_top #search{
  margin-left: 8px;   /* 必要に応じて 4〜12px で調整 */
  line-height: 1;
}

/* ========== #search 内の Google CSE を“狭幅・29px”で固定 ========== */

/* 外枠は透明・余計な枠なし */
.fnc_wrap .fnc_top #search .gsc-control-cse,
.fnc_wrap .fnc_top #search .gsc-control-wrapper-cse{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 検索枠全体（table）に薄い枠＆角丸＋高さ固定 */
.fnc_wrap .fnc_top #search table.gsc-search-box{
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: #fff !important;
  border: 1px solid #cfcfcf !important;   /* 薄いグレー枠 */
  border-radius: 5px !important;
  height: 29px !important;
  padding: 0 !important;
  margin: 0 !important;
}
.fnc_wrap .fnc_top #search table.gsc-search-box td{
  padding: 0 !important;
  vertical-align: middle !important;
}

/* 右端のクリアセルは不使用（幅ズレ防止） */
.fnc_wrap .fnc_top #search td.gsc-clear-button,
.fnc_wrap .fnc_top #search .gsc-clear-button,
.fnc_wrap .fnc_top #search .gsst_a{
  display: none !important;
}

/* 入力欄（左）：狭幅・29px固定 */
.fnc_wrap .fnc_top #search .gsc-input-box{
  border: none !important;
  background: transparent !important;
  height: 29px !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}
.fnc_wrap .fnc_top #search .gsc-input-box input.gsc-input{
  width: 160px !important;              /* ★ 狭幅 */
  height: 29px !important;
  line-height: 27px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
  font-size: 0.85rem !important;
  color: #222 !important;
  background: #fff !important;
  background-image: none !important;    /* 既定ロゴを消す */
  border: none !important;
  outline: none !important;
}

/* ボタン（右）：狭幅・緑・右角丸 */
.fnc_wrap .fnc_top #search td.gsc-search-button{
  width: 50px !important;               /* ★ 狭幅 */
  padding: 0 !important;
  border-left: 1px solid #cfcfcf !important; /* 入力枠との境目 */
  border-top-right-radius: 5px !important;
  border-bottom-right-radius: 5px !important;
  overflow: visible !important;
}
.fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2{
  width: 50px !important;               /* ★ 狭幅 */
  height: 29px !important;
  padding: 0 !important;
  background: #018838 !important;
  color: #fff !important;
  font-size: 0.8rem !important;
  border: 1px solid #018838 !important;
  border-left: 0 !important;            /* セルの境界線と重複させない */
  border-radius: 0 5px 5px 0 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}
.fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2 svg{
  width: 12px !important;
  height: 12px !important;
}

/* “消しCSS” への最終防御（display:none を上書き） */
.fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button{
  display: table-cell !important;
}
.fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2{
  display: inline-flex !important;
}

/***** ヘッダー行を横一列にし、検索を右隣に *****/
.fnc_wrap .fnc_top{
  display:flex;
  align-items:center;
  gap:10px;
  list-style:none;
  padding:0; margin:0;
}
.fnc_wrap .fnc_top #search{
  display:inline-block;       /* 横並びで独立させる */
  margin-left:8px;            /* 都庁リンクとの間隔。6〜12pxで微調整可 */
  line-height:1;
  white-space:nowrap;         /* 内部で改行させない */
}

/***** “横幅がくそデカい” を止める肝：幅100%の上書き *****/
/* 生成される内側テーブルやラッパーは100%を付けてくる → auto/固定pxに強制 */
.fnc_wrap .fnc_top #search table.gsc-search-box,
.fnc_wrap .fnc_top #search .gsc-input-box,
.fnc_wrap .fnc_top #search .gsc-input,
.fnc_wrap .fnc_top #search [id^="gs_id"] {
  width:auto !important;          /* ← 100%を打ち消す */
  max-width:none !important;
}

/***** “二枚目の大きさ”＝ミニ幅（入力160×29 / ボタン50×29）で固定 *****/
/* 外枠（ひとつの箱に見せる） */
.fnc_wrap .fnc_top #search table.gsc-search-box{
  border-collapse:separate !important;
  border-spacing:0 !important;
  background:#fff !important;
  border:1px solid #cfcfcf !important;
  border-radius:5px !important;
  height:29px !important;
  padding:0 !important; margin:0 !important;
}

/* セル余白は詰める */
.fnc_wrap .fnc_top #search table.gsc-search-box td{
  padding:0 !important; vertical-align:middle !important;
}

/* クリアセルは使わない */
.fnc_wrap .fnc_top #search td.gsc-clear-button,
.fnc_wrap .fnc_top #search .gsc-clear-button,
.fnc_wrap .fnc_top #search .gsst_a{ display:none !important; }

/* 入力側（左） */
.fnc_wrap .fnc_top #search .gsc-input-box{
  border:none !important; background:transparent !important;
  height:29px !important; display:flex !important; align-items:center !important;
  box-sizing:border-box !important;
}
.fnc_wrap .fnc_top #search .gsc-input-box input.gsc-input{
  width:160px !important;                 /* ★ここでミニ幅 */
  height:29px !important; line-height:27px !important;
  padding:0 8px !important; box-sizing:border-box !important;
  font-size:0.85rem !important; color:#222 !important;
  background:#fff !important; background-image:none !important;
  border:none !important; outline:none !important;
}

/* ボタン側（右） */
.fnc_wrap .fnc_top #search td.gsc-search-button{
  width:50px !important;                  /* ★ここでミニ幅 */
  padding:0 !important;
  border-left:1px solid #cfcfcf !important;
  border-top-right-radius:5px !important; border-bottom-right-radius:5px !important;
  overflow:visible !important;
}
.fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2{
  width:50px !important; height:29px !important; padding:0 !important;
  background:#018838 !important; color:#fff !important; font-size:0.8rem !important;
  border:1px solid #018838 !important; border-left:0 !important;
  border-radius:0 5px 5px 0 !important; cursor:pointer !important;
  display:inline-flex !important; align-items:center !important; justify-content:center !important;
  box-sizing:border-box !important;
}
.fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2 svg{
  width:12px !important; height:12px !important;
}

/* たまに display:none を食らう対策（相手が !important でも勝つ） */
.fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button{ display:table-cell !important; }
.fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2{ display:inline-flex !important; }

/* 1) 内側ラッパーの 100% 幅・自動高さを打ち消す（横幅が「くそデカい」対策の補強） */
.fnc_wrap .fnc_top #search [id^="gs_id"],
.fnc_wrap .fnc_top #search .gsc-input {
  width: auto !important;
  max-width: none !important;
  height: 29px !important;                /* ← 高さを親と揃える */
  line-height: 29px !important;           /* ← baselineでの伸びを防ぐ */
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* 2) テーブル本体の高さを 29px に固定（33.5pxに膨らむのを抑止） */
.fnc_wrap .fnc_top #search table.gsc-search-box{
  height: 29px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

/* 3) 各セルも 29px に合わせ、baseline 影響を無効化（行内基準の上下ズレ対策） */
.fnc_wrap .fnc_top #search table.gsc-search-box td{
  height: 29px !important;
  line-height: 0 !important;              /* ← ここがズレ防止の肝 */
  vertical-align: middle !important;
  padding: 0 !important;
}

/* 4) 入力（左）— 29px固定・テキストは視覚中央に */
.fnc_wrap .fnc_top #search .gsc-input-box{
  height: 29px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-sizing: border-box !important;
}
.fnc_wrap .fnc_top #search .gsc-input-box input.gsc-input{
  width: 160px !important;                /* 必要なら 150 や 140 に更に縮め可 */
  height: 29px !important;
  line-height: 27px !important;           /* テキストの上下センタリング */
  padding: 0 8px !important;
  border: none !important;
  background: #fff !important;
  background-image: none !important;
  box-sizing: border-box !important;
  font-size: 0.85rem !important;
  color: #222 !important;
}

/* 5) ボタンセル— 左境界線だけ表示（“右下ズレ”の視覚要因を排除） */
.fnc_wrap .fnc_top #search td.gsc-search-button{
  width: 50px !important;                 /* 必要なら 44〜48 にさらに縮め可 */
  height: 29px !important;
  line-height: 0 !important;              /* ← baselineの余白を消す */
  padding: 0 !important;
  border-left: 1px solid #cfcfcf !important;
  border-top-right-radius: 5px !important;
  border-bottom-right-radius: 5px !important;
  overflow: visible !important;
}

/* 6) ボタン本体— “枠の中で完全フィット” させる（右下ズレ解消の決め手） */
.fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2{
  display: block !important;              /* inline系に起きる baselineズレを排除 */
  width: 50px !important;
  height: 29px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #018838 !important;
  color: #fff !important;
  border: 1px solid #018838 !important;
  border-left: 0 !important;              /* セルの左境界線と重複させない */
  border-radius: 0 5px 5px 0 !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
}

/* ボタン内のアイコン位置を真正面に */
.fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2 > svg{
  position: relative !important;
  top: 0 !important; left: 0 !important;
  width: 12px !important; height: 12px !important;
  display: block !important;              /* 行内要素の baseline影響を受けない */
  margin: auto !important;                /* 中央配置 */
}

/* 7) “display:none” に消される事故の保険（既に入れていれば重複OK） */
.fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button{ display: table-cell !important; }
.fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2{ display: block !important; }

/* =====================
   #search ブロックを 270px に固定
   ===================== */
   .fnc_wrap .fnc_top #search {
    display: inline-block;             /* 横並びにする */
    width: 270px !important;           /* ★ 合計幅を固定 */
    max-width: 270px !important;
    white-space: nowrap;               /* 折返しで縦に伸びないように */
    line-height: 1;                    /* ベースラインで縦に膨らまない */
  }
  
  /* CSE が入れる “100%幅” をすべて潰す（肝） */
  .fnc_wrap .fnc_top #search table.gsc-search-box,
  .fnc_wrap .fnc_top #search .gsc-control-cse,
  .fnc_wrap .fnc_top #search .gsc-control-wrapper-cse,
  .fnc_wrap .fnc_top #search .gsc-input-box,
  .fnc_wrap .fnc_top #search .gsc-input,
  .fnc_wrap .fnc_top #search [id^="gs_id"] {
    width: 270px !important;           /* 外枠と同じにロック */
    max-width: 270px !important;
    box-sizing: border-box !important;
  }
  
  /* 外枠（枠線＋角丸＋高さ固定） */
  .fnc_wrap .fnc_top #search table.gsc-search-box {
    height: 29px !important;
    border: 1px solid #cfcfcf !important;
    border-radius: 5px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* セルの余白をゼロ、高さを29pxに固定（行のはみ出し防止） */
  .fnc_wrap .fnc_top #search table.gsc-search-box td {
    padding: 0 !important;
    height: 29px !important;
    line-height: 0 !important;         /* baseline でのズレを抑止 */
    vertical-align: middle !important;
  }
  
  /* クリアセルは非表示（横幅が増える要因を排除） */
  .fnc_wrap .fnc_top #search td.gsc-clear-button,
  .fnc_wrap .fnc_top #search .gsc-clear-button,
  .fnc_wrap .fnc_top #search .gsst_a { display: none !important; }
  
  /* 入力ボックス（左） */
  .fnc_wrap .fnc_top #search .gsc-input-box {
    width: 220px !important;           /* ★ 入力領域の幅 */
    height: 29px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
  }
  .fnc_wrap .fnc_top #search .gsc-input-box input.gsc-input {
    width: 220px !important;           /* ★ 入力幅（外側に合わせる） */
    height: 29px !important;
    line-height: 27px !important;
    padding: 0 8px !important;
    border: none !important;
    background: #fff !important;
    background-image: none !important;
    font-size: 0.85rem !important;
    color: #222 !important;
    box-sizing: border-box !important;
    outline: none !important;
  }
  
  /* ボタンセル（右） */
  .fnc_wrap .fnc_top #search td.gsc-search-button {
    width: 50px !important;            /* ★ ボタン側の幅 */
    height: 29px !important;
    padding: 0 !important;
    border-left: 1px solid #cfcfcf !important;
    border-top-right-radius: 5px !important;
    border-bottom-right-radius: 5px !important;
    overflow: visible !important;
  }
  
  /* ボタン本体（右下ズレ解消：display:block + 高さ/幅ぴったり） */
  .fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2 {
    display: block !important;         /* ← baselineのズレを根こそぎ解消 */
    width: 50px !important;
    height: 29px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #018838 !important;
    color: #fff !important;
    border: 1px solid #018838 !important;
    border-left: 0 !important;         /* セルの左境界線と重複させない */
    border-radius: 0 5px 5px 0 !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
  }
  .fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2 svg {
    display: block !important;         /* baselineの影響を受けない */
    width: 12px !important;
    height: 12px !important;
    margin: auto !important;           /* 中央に */
  }
  
  /* 念のための“可視化”保険（display:none対策） */
  .fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button { display: table-cell !important; }
  .fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2 { display: block !important; }

  /* li の固定高さを解除（“青枠”が29pxの白枠に一致する） */
.fnc_wrap .fnc_top > li[style] {
  height: auto !important;        /* ← これで子の高さに追従 */
  line-height: normal !important; /* ベースラインの影響をクリア */
}

/* #search コンテナも29px or autoに揃えてブレを無くす */
.fnc_wrap .fnc_top #search {
  height: 29px !important;        /* 外枠＝内枠に合わせる */
  line-height: 1 !important;      /* 行高由来の膨張を防止 */
  display: inline-block;          /* 既に指定済みでもOK（保険） */
  white-space: nowrap;
}

/* CSEが入れる100%幅を抑止（もう一度最後で上書き） */
.fnc_wrap .fnc_top #search table.gsc-search-box,
.fnc_wrap .fnc_top #search .gsc-input-box,
.fnc_wrap .fnc_top #search .gsc-input,
.fnc_wrap .fnc_top #search [id^="gs_id"] {
  width: 270px !important;   /* 目標：外枠と同寸。220+50=270 の合計幅 */
  max-width: 270px !important;
  height: 29px !important;   /* 縦も揃える */
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

/***** 0) 外枠（#search の箱）を 270px に固定 *****/
.fnc_wrap .fnc_top #search{
  display:inline-block;
  width:270px !important;
  max-width:270px !important;
  height:29px !important;      /* ← 青い枠＝白い枠（29px）に一致させる */
  line-height:1 !important;
  white-space:nowrap;
}

/***** 1) CSE が入れる “100%幅” を潰し、テーブルに固定幅レイアウトを強制 *****/
.fnc_wrap .fnc_top #search table.gsc-search-box,
.fnc_wrap .fnc_top #search .gsc-control-cse,
.fnc_wrap .fnc_top #search .gsc-control-wrapper-cse,
.fnc_wrap .fnc_top #search .gsc-input-box,
.fnc_wrap .fnc_top #search .gsc-input,
.fnc_wrap .fnc_top #search [id^="gs_id"]{
  width:270px !important;        /* ← 外枠と同幅でロック */
  max-width:270px !important;
  height:29px !important;
  margin:0 !important;
  padding:0 !important;
  box-sizing:border-box !important;
}
.fnc_wrap .fnc_top #search table.gsc-search-box{
  table-layout:fixed !important; /* ← セル幅の指定を厳守させる（ボタンが飛ぶのを防止） */
  border-collapse:separate !important;
  border-spacing:0 !important;
  background:#fff !important;
  border:1px solid #cfcfcf !important;
  border-radius:5px !important;
}

/***** 2) セルの寸法を “入力220px + ボタン50px” で固定（勝ち切る） *****/
.fnc_wrap .fnc_top #search table.gsc-search-box td.gsc-input{
  width:220px !important;        /* ★ 入力セル幅を固定 */
  padding:0 !important;
  height:29px !important;
  vertical-align:middle !important;
  line-height:0 !important;
}
.fnc_wrap .fnc_top #search table.gsc-search-box td.gsc-search-button{
  width:50px !important;         /* ★ ボタンセル幅を固定 */
  padding:0 !important;
  height:29px !important;
  vertical-align:middle !important;
  line-height:0 !important;
  border-left:1px solid #cfcfcf !important;
  border-top-right-radius:5px !important;
  border-bottom-right-radius:5px !important;
  overflow:visible !important;
}

/***** 3) 入力欄とボタン本体を箱にピッタリ収める（baselineズレを排除） *****/
.fnc_wrap .fnc_top #search .gsc-input-box{
  width:220px !important;
  height:29px !important;
  display:flex !important;
  align-items:center !important;
  padding:0 !important; margin:0 !important;
  background:transparent !important;
  border:none !important;
}
.fnc_wrap .fnc_top #search .gsc-input-box input.gsc-input{
  width:220px !important;
  height:29px !important;
  line-height:27px !important;   /* 視覚中央 */
  padding:0 8px !important;
  border:none !important;
  background:#fff !important;
  background-image:none !important;
  font-size:14px !important;     /* 端数→整数pxでサブピクセル滲みを軽減 */
  color:#222 !important;
  box-sizing:border-box !important;
  outline:none !important;
}

/* ボタン本体：display:block でベースラインの影響を断ち切る */
.fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2{
  display:block !important;
  width:50px !important;
  height:29px !important;
  padding:0 !important; margin:0 !important;
  background:#018838 !important;
  color:#fff !important;
  border:1px solid #018838 !important;
  border-left:0 !important;               /* セル境界線との重複回避 */
  border-radius:0 5px 5px 0 !important;
  box-sizing:border-box !important;
  cursor:pointer !important;
}
.fnc_wrap .fnc_top #search td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2 svg{
  display:block !important;
  width:12px !important; height:12px !important;
  margin:auto !important;                 /* 正中に配置 */
}

/***** 4) “display:none に消される”系の保険（過去の事象対策） *****/
.fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button{ display:table-cell !important; }
.fnc_wrap .fnc_top #search .gsc-control-cse td.gsc-search-button > button.gsc-search-button.gsc-search-button-v2{ display:block !important; }