@charset "UTF-8";

/*
 * スマホ向け改善 第2段: 下に固定のナビ・下から出るシート・表示中の回線の札(2026-10-18)
 *
 * 部品は components/member/MobileTabBar.tsx(.mtab と2つのシート)・ContractChip.tsx(.mchip)・BottomSheet.tsx(.msheet)。
 * 【834px 以下だけ】PC は右上のメニュー(ハンバーガー)のまま。契約の切り替えは見出しのお客様の欄(account.css)から、
 *   同じ回線の一覧(LineSheet)を画面の中央の窓で出す(2026-10-18。シートと一覧の見た目はこのファイルの後半。PC でも効く)。
 * 【ログインしている画面だけ】下のナビはログイン後だけ描かれる。ログイン画面などでは右上のメニューを残す
 *   (body:has(.mtab) で見分ける)。
 * 【戻し方】app/(member)/layout.tsx の /css/mobile-nav.css の1行と、MemberShell.tsx の <MobileTabBar />、
 *   MemberHeader.tsx の <ContractChip /> を消せば元に戻る。
 */

/* PC では出さない */
.mtab,
.mchip {
  display: none;
}

/* 画面には出さず、読み上げだけ */
.msheet-sr,
.lr-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media screen and (max-width: 834px) {
  /* ---- 右上のメニューと、下層の契約の選択欄を、新しい部品に置き換える(ログイン後だけ) ----
     右上のメニューのパネルは div#nav(2026-11-07 ハンバーガーメニュー Phase 1。以前は nav#nav) */
  body:has(.mtab) #mobile-head,
  body:has(.mtab) #nav {
    display: none;
  }
  body:has(.mtab) #header {
    gap: 8px;
    padding: 0 10px;
  }
  body:has(.mtab) div#logo {
    flex: none;
    width: 100px;
    margin: 0;
  }
  /* ロゴ(ホームへ戻る)も指で押せる高さに(画像だけだと 30px)。
     下のナビを出さない画面(解約の手続き。2026-10-27 C-5。.mtab-off)でも同じ */
  body:has(.mtab) div#logo a,
  body:has(.mtab-off) div#logo a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  /* 下のナビを出さない画面(解約の手続き)のヘッダー(2026-11-07 ハンバーガーメニュー Phase 4)。
     右上のメニューの開閉ボタン(50px)があるぶん狭いのに、ロゴが古い指定の 150px のままで、
     回線の札の電話番号が「090-1111-222」と切れ、保有ポイントが「保有ポイン/ト」と折れていた。ロゴを小さくして間を詰める */
  body:has(.mtab-off) #header {
    gap: 4px;
    padding: 0 54px 0 8px;
  }
  body:has(.mtab-off) div#logo {
    flex: none;
    width: 84px;
    margin: 0;
  }
  /* ロゴの大きさは動かさない(2026-11-09)。共通の style.css の div#logo に transition: 0.3s ease があり、
     ログインの情報が届いてこのヘッダーに切り替わるとき、ロゴが 150px から 0.3 秒かけて縮んでいた。
     その間は回線の札が押しつぶされ、電話番号が「090-1111-…」と切れて見えた(e2e の member-menu が確かめる) */
  body:has(.mtab) div#logo,
  body:has(.mtab-off) div#logo {
    transition: none;
  }
  body:has(.mtab-off) #header #head-point p {
    letter-spacing: 0;
    white-space: nowrap;
  }
  body:has(.mtab-off) .mchip-label {
    padding: 0 4px 0 10px;
    letter-spacing: 0;
  }
  body:has(.mchip) div.headline div.user-data,
  body:has(.mchip) div.headline.is-lower {
    display: none;
  }
  /* 本文の下を、ナビの高さだけ空ける(最後の行やボタンがナビに隠れないように) */
  body:has(.mtab) #wrapper {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  /* 画面が自分で欄へ運ぶとき(入力の誤りでブラウザが運ぶ・「修正」で戻る など)も、ナビの下に隠さない。
     以前は同意のチェックがナビの真下に運ばれ、押そうとするとナビの「ホーム」に触れていた(2026-10-18 実測)。
     ブラウザが運ぶのは 1px に縮めた本物のチェックで、押す文字(label。約100px)はその下に続くため、その分も空ける */
  html:has(body .mtab) {
    scroll-padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px));
  }
  /* 通知(トースト)はナビの上に出す */
  body:has(.mtab) .msc-toast-region {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
  /* 画面のキーボードが出ているあいだは隠す(キーボードの上に浮いて、入力している欄を隠さないように。第4段)。
     kb-open は lib/member/keyboard.ts が付ける(フォーカスだけでは付けない。Android は閉じてもフォーカスが残る) */
  html.kb-open .mtab {
    display: none;
  }

  /* ---- 表示中の回線の札(ヘッダー) ---- */
  .mchip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    min-height: 44px;
    margin-right: auto;
    padding: 0;
    font-family: inherit;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .mchip-label {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 6px 0 12px;
    overflow: hidden;
    font-family: "Roboto", sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #273343;
    background: #f2f5f8;
    border: 1px solid #dfe5ec;
    border-right: 0;
    border-radius: 999px 0 0 999px;
  }
  .mchip svg {
    flex: none;
    width: 26px;
    height: 32px;
    padding: 0 8px 0 2px;
    color: #00796b;
    background: #f2f5f8;
    border: 1px solid #dfe5ec;
    border-left: 0;
    border-radius: 0 999px 999px 0;
  }

  /* ---- 下に固定のナビ ---- */
  .mtab {
    display: block;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid #e3e8ef;
    box-shadow: 0 -8px 24px -18px rgba(39, 51, 67, 0.55);
  }
  .mtab ul {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .mtab-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    min-height: 58px;
    padding: 6px 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #5f6b7a;
    text-decoration: none;
    white-space: nowrap;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .mtab-item svg {
    width: 22px;
    height: 22px;
  }
  .mtab-item[aria-current="page"],
  .mtab-item.is-current,
  .mtab-item[aria-expanded="true"] {
    color: #00796b;
  }
  .mtab-item[aria-current="page"]::before,
  .mtab-item.is-current::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 28px;
    height: 3px;
    margin-left: -14px;
    background: #00796b;
    border-radius: 0 0 3px 3px;
  }
  .mtab-dot {
    position: absolute;
    top: 7px;
    left: calc(50% + 7px);
    width: 9px;
    height: 9px;
    background: #cd2b31;
    border: 2px solid #fff;
    border-radius: 50%;
  }

  /* お手続き(絵つきの3列) */
  .mproc {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .mproc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    min-height: 92px;
    padding: 12px 4px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    color: #273343;
    text-decoration: none;
    background: #f6f8fb;
    border-radius: 14px;
  }
  .mproc-item[aria-current="page"] {
    background: #e6f5f3;
    box-shadow: inset 0 0 0 2px #00796b;
  }
  .mproc-icon img {
    width: 40px;
    height: 40px;
  }
  /* 名前は決めた所で折り返す(MenuLabel.tsx)。収まらないときだけ言葉の途中で折る */
  .mproc-label {
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  /* その他(行の一覧) */
  .msheet-rows {
    overflow: hidden;
    border: 1px solid #e6ebf1;
    border-radius: 14px;
  }
  .msheet-rows li + li {
    border-top: 1px solid #edf0f4;
  }
  .msheet-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: #273343;
    text-decoration: none;
    background: #fff;
  }
  .msheet-row[aria-current="page"] {
    background: #f2faf8;
  }
  .msheet-row-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    color: #00796b;
    background: #eef6f5;
    border-radius: 10px;
  }
  .msheet-row-icon svg {
    width: 18px;
    height: 18px;
  }
  .msheet-row-label {
    flex: 1;
    min-width: 0;
  }
  .msheet-row-go {
    flex: none;
    width: 16px;
    height: 16px;
    color: #9aa4b2;
  }
  .msheet-badge {
    flex: none;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: #cd2b31;
    border-radius: 999px;
  }
  .msheet-loyalty {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    margin-top: 16px;
    padding: 10px 14px;
    color: #273343;
    text-decoration: none;
    background: linear-gradient(135deg, #fffdf3 0%, #f0dc8e 100%);
    border: 1px solid rgba(183, 155, 0, 0.3);
    border-radius: 14px;
  }
  .msheet-loyalty > svg:first-child {
    flex: none;
    width: 22px;
    height: 22px;
    color: #806c00;
  }
  .msheet-loyalty span {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
  }
  .msheet-loyalty b {
    font-size: 13px;
    font-weight: 800;
  }
  .msheet-loyalty small {
    font-size: 12px;
    color: #5f4f00;
  }
  .msheet-loyalty > svg:last-child {
    flex: none;
    width: 16px;
    height: 16px;
    color: #806c00;
  }
  .msheet-howto {
    margin-top: 12px;
    padding: 0 14px;
    border: 1px solid #e6ebf1;
    border-radius: 14px;
  }
  .msheet-howto summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    font-size: 14px;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
  }
  .msheet-howto summary::-webkit-details-marker {
    display: none;
  }
  .msheet-howto summary svg {
    width: 18px;
    height: 18px;
    color: #00796b;
  }
  .msheet-howto p,
  .msheet-howto dl {
    font-size: 13px;
    line-height: 1.7;
    color: #3b4654;
  }
  .msheet-howto dl {
    padding: 6px 0 14px;
  }
  .msheet-howto dt {
    margin-top: 6px;
    font-weight: 800;
  }
  .msheet-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    margin-top: 18px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #273343;
    background: #fff;
    border: 1.5px solid #cfd8e0;
    border-radius: 14px;
    cursor: pointer;
  }
  .msheet-logout svg {
    width: 18px;
    height: 18px;
  }

}

/* ================================================================
   回線の一覧の窓(LineSheet)とシートの土台は、PC でも使う(2026-10-18 PC のお客様の欄から開く)。
   スマホでは下から出るシート、PC(835px 以上)では画面の中央の窓(下の min-width の指定)。
   ================================================================ */
/* ---- 下から出るシート ---- */
body.msheet-open {
  overflow: hidden;
}
.msheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.msheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.45);
  border: 0;
  cursor: pointer;
}
.msheet-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color: #273343;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 32px -12px rgba(15, 23, 42, 0.35);
  animation: msheet-up 0.22s ease-out;
}
@keyframes msheet-up {
  from {
    transform: translateY(24px);
    opacity: 0.4;
  }
}
.msheet-head {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 8px 8px 20px;
  border-bottom: 1px solid #edf0f4;
}
.msheet-grip {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 40px;
  height: 4px;
  margin-left: -20px;
  background: #d5dbe2;
  border-radius: 2px;
}
/* 見出しは古い CSS(h2 の上下の線・h3 の左のバーなど)を打ち消して、シートの見た目にする */
.msheet .msheet-title {
  margin: 0;
  padding: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
  text-align: left;
  color: #273343;
  background: none;
  border: 0;
  outline: none;
}
.msheet .msheet-title::before,
.msheet .msheet-title::after,
.msheet .msheet-group-title::before,
.msheet .msheet-group-title::after {
  display: none;
}
/* 題(h2)のすぐ後ろなので、古い CSS の「h2 + * の上の余白(15〜25px)」が付き、閉じるボタンが題より下にずれていた */
.msheet .msheet-close {
  margin: 0;
}
.msheet-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #273343;
  background: none;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.msheet-close svg {
  width: 22px;
  height: 22px;
}
.msheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px 24px;
}
.msheet-group + .msheet-group {
  margin-top: 6px;
}
.msheet .msheet-group-title {
  margin: 12px 4px 8px;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: left;
  color: #5f6b7a;
  background: none;
  border: 0;
}

/* お客様ID(その他のシート・回線の一覧) */
.msheet-account {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 4px 2px;
  font-size: 13px;
  color: #5f6b7a;
}
.msheet-account b {
  font-family: "Roboto", sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #273343;
}
/* 表示する回線(札から開く) */
.mline-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.mline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  font-family: inherit;
  text-align: left;
  color: #273343;
  background: #fff;
  border: 1.5px solid #dfe5ec;
  border-radius: 14px;
  cursor: pointer;
}
.mline.is-current {
  background: #f2faf8;
  border-color: #00796b;
}
.mline:disabled {
  cursor: progress;
  opacity: 0.6;
}
.mline-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mline-tel {
  font-family: "Roboto", sans-serif;
  font-size: 18px;
  font-weight: 800;
}
.mline-plan {
  font-size: 12.5px;
  color: #5f6b7a;
}
.mline-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: #00796b;
  border-radius: 999px;
}
.mline-badge svg {
  width: 14px;
  height: 14px;
}
.mline-go {
  flex: none;
  font-size: 12.5px;
  font-weight: 700;
  color: #00796b;
}
.mline-note {
  margin: 10px 4px 0;
  font-size: 12.5px;
  color: #5f6b7a;
}
.mline-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #00796b;
  text-decoration: none;
  background: #eef6f5;
  border-radius: 12px;
}
.mline-all svg {
  width: 16px;
  height: 16px;
}

/* コピーのボタン(CopyButton.tsx。お客様ID。回線の一覧の窓・PC のお客様の欄) */
.copy-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #00796b;
  cursor: pointer;
  background: #fff;
  border: 1.5px solid #bfe3dd;
  border-radius: 999px;
}
.copy-btn svg {
  width: 14px;
  height: 14px;
}
.copy-btn:hover {
  background: #eef6f5;
}
.copy-btn.is-done {
  color: #fff;
  background: #00796b;
  border-color: #00796b;
}
.msheet-account .copy-btn {
  align-self: center;
  margin-left: auto;
}

/* PC(835px 以上)では、回線の一覧を画面の中央の窓で出す(下から出るシートは指で操作するスマホのため) */
@media screen and (min-width: 835px) {
  .msheet {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .msheet-panel {
    width: min(480px, 100%);
    max-height: min(80vh, 680px);
    padding-bottom: 0;
    border-radius: 18px;
    box-shadow: 0 24px 64px -24px rgba(15, 23, 42, 0.5);
    animation: msheet-pop 0.16s ease-out;
  }
  @keyframes msheet-pop {
    from {
      transform: scale(0.97);
      opacity: 0.4;
    }
  }
  .msheet-grip {
    display: none;
  }
  .mline:hover {
    border-color: #00796b;
  }
}

/* スマホでは、コピーのボタンも指で押せる高さに */
@media screen and (max-width: 834px) {
  .msheet-account .copy-btn {
    min-height: 44px;
    padding: 0 14px;
  }
}

/* 幅の狭い電話(375px 未満)では、ロゴを少し小さくして「紹介ポイント」が「紹介ポイン/ト」と折れないようにする */
@media screen and (max-width: 374px) {
  body:has(.mtab) div#logo {
    width: 80px;
  }
  /* 下のナビを出さない画面は、右上のメニューの開閉ボタンのぶん、さらに小さく(Phase 4) */
  body:has(.mtab-off) div#logo {
    width: 72px;
  }
  body:has(.mtab) #header #head-point p {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msheet-panel {
    animation: none;
  }
}
