/* =========================================================
   Plan B 2026-09-05: 右端の耳タブをフッター固定CTAへ（9/4 XDピン20）
   - 耳タブが出ていた 769〜1680px の範囲だけを、画面下部の固定バーに置き換える。
   - 見た目はヘッダーと同じ系統（白背景・上向きの薄いシャドウ）。ボタンはヘッダー右上と同じ濃い紺 #1a2b5c 単色・白文字（2026-09-05 19:30 変更）・角丸2px（2026-09-06）。電話番号は緑 #0E8259、受話器アイコンは番号に密着（gap 4px・2026-09-06）。
   - 1681px以上（ヘッダー横並び）と 768px以下（SP固定バー・9/2実装）は既存のまま。
   - 既存 global-ear-tabs-20260824.css の後に読み込む前提（同じセレクタ＋!important で上書き）。
   - 注意: ヘッダーも固定のため、上下固定でコンテンツの表示エリアがバーの高さ分（72px）狭くなる。
   ========================================================= */
@media (min-width: 769px) and (max-width: 1680px) {
  :root {
    --planb-bottom-cta-height: 72px;
    --planb-cta-navy: #1a2b5c;
    --planb-cta-border: #b6cae9;
    --planb-cta-sky: #1e8fc9;
  }

  html body {
    padding-bottom: var(--planb-bottom-cta-height) !important;
  }

  html body .global-ear-tabs,
  html body .header:not(.header-min) .header-actions.global-ear-tabs,
  html.nav-drawer-ready body .header:not(.header-min) .header-actions.global-ear-tabs {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1500 !important;
    display: flex !important;
    width: 100% !important;
    height: var(--planb-bottom-cta-height) !important;
    margin: 0 !important;
    padding: 0 24px !important;
    flex: none !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    box-sizing: border-box !important;
    transform: none !important;
    pointer-events: auto !important;
    background: #fff !important;
    border-top: 1px solid #e5e9ee !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .08) !important;
  }

  /* 電話番号を固定バーの左に追加（SP1-8の方向。色は候補A #0E8259。須藤さん指示 2026-09-05） */
  html body .global-ear-tabs > .tel-widget,
  html body .header:not(.header-min) .header-actions.global-ear-tabs > .tel-widget,
  html.nav-drawer-ready body .header:not(.header-min) .header-actions.global-ear-tabs > .tel-widget {
    display: flex !important;
    position: static !important;
    order: 0 !important;
    width: auto !important;
    height: 44px !important;
    margin: 0 12px 0 0 !important;
    padding: 0 !important;
    align-items: center !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  html body .global-ear-tabs .telx,
  html body .global-ear-tabs .telx-cb {
    display: none !important;
  }

  html body .global-ear-tabs .header-tel-btn {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important; /* アイコンを番号にくっつける（須藤さん指示 2026-09-06 11:58。ヘッダー横並びの2〜3pxに合わせる） */
    height: 44px !important;
    padding: 0 16px !important;
    color: #0E8259 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    writing-mode: horizontal-tb !important;
    transform: none !important;
  }

  html body .global-ear-tabs .header-tel-btn .header-tel-icon {
    display: inline-block !important;
    margin: 0 !important;
    color: #0E8259 !important;
    font-size: 20px !important;
  }

  html body .global-ear-tabs .header-tel-textcol {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    line-height: 1.15 !important;
  }

  html body .global-ear-tabs .header-tel-number {
    color: #0E8259 !important;
    font-family: "Oswald", "Noto Sans JP", sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: .02em !important;
    white-space: nowrap !important;
  }

  html body .global-ear-tabs .header-tel-label {
    margin-top: 2px !important;
    color: #5c6b7a !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  /* ホバーで色は変えない（須藤さん指示 2026-09-05） */
  html body .global-ear-tabs .header-tel-btn:hover .header-tel-icon,
  html body .global-ear-tabs .header-tel-btn:hover .header-tel-number {
    color: #0E8259 !important;
  }

  html body .global-ear-tabs > .header-contact-btn {
    order: 1 !important;
  }

  html body .global-ear-tabs > .header-demo-btn {
    order: 2 !important;
  }

  html body .global-ear-tabs > .header-demo-apply-btn {
    order: 3 !important;
  }

  html body .global-ear-tabs > .header-action-item {
    position: static !important;
    display: inline-flex !important;
    width: 220px !important;
    max-width: 30% !important;
    height: 44px !important;
    min-height: 44px !important;
    flex: 0 0 220px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    overflow: visible !important;
    writing-mode: horizontal-tb !important;
    color: #fff !important;
    background: var(--planb-cta-navy) !important;
    background-image: none !important;
    border: 1px solid var(--planb-cta-navy) !important;
    border-radius: 2px !important; /* ほんの少しだけ丸く（須藤さん指示 2026-09-06 11:58） */
    box-shadow: none !important;
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: .02em !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    transform: none !important;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease !important;
  }

  html body .global-ear-tabs > .header-action-item::before,
  html body .global-ear-tabs > .header-action-item::after {
    content: none !important;
    display: none !important;
  }

  html body .global-ear-tabs > .header-action-item > i {
    display: inline-block !important;
    position: static !important;
    margin: 0 !important;
    color: currentColor !important;
    font-size: 15px !important;
  }

  html body .global-ear-tabs > .header-demo-apply-btn > span {
    display: inline !important;
  }

  /* ヘッダー右上のボタンと同じ濃い紺・白文字（須藤さん指示 2026-09-05 19:30） */
  html body .global-ear-tabs > .header-action-item:hover {
    color: #fff !important;
    background: #112e56 !important;
    border-color: #112e56 !important;
    box-shadow: none !important;
    transform: none !important;
  }

  html body .global-ear-tabs > .header-action-item:focus-visible {
    position: relative !important;
    z-index: 1 !important;
    outline: 3px solid var(--planb-cta-sky) !important;
    outline-offset: 3px !important;
    box-shadow: none !important;
  }
}

/* 狭いPC幅では電話の受付時間を省き、ボタンを均等に縮める */
@media (min-width: 769px) and (max-width: 1200px) {
  html body .global-ear-tabs .header-tel-label {
    display: none !important;
  }

  html body .global-ear-tabs .header-tel-number {
    font-size: 20px !important;
  }

  html body .global-ear-tabs > .header-action-item {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 8px !important;
    font-size: 13px !important;
  }
}
