/* ==========================================================================
   layout.css — グローバルヘッダー / サイドバー / ページ骨格
   ========================================================================== */

/* ヘッダーとサイドバーは固定し、本文だけがスクロールする。
   ページ全体をスクロールさせると、サイドバーが一緒に流れてしまうため。 */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .app {
    min-width: var(--w-page-min);
  }
}

/* --- グローバルヘッダー ------------------------------------------------ */
.gheader {
  display: flex;
  align-items: stretch;
  height: var(--h-header);
  background: var(--c-header-bg);
  color: var(--c-text-inv);
  flex: 0 0 auto;
  position: relative;
  z-index: var(--z-dropdown);
}

/* 768px 未満だけ表示。サイドバードロワーを開く */
.gheader__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--h-header);
  padding: 0;
  background: none;
  border: 0;
  border-right: 1px solid var(--c-on-dark-sep);
  color: var(--c-text-inv);
  cursor: pointer;
}

.gheader__menu-btn svg {
  width: var(--sz-headericon);
  height: var(--sz-headericon);
}

.gheader__menu-btn:hover {
  background: var(--c-header-bg-dark);
}

.gheader__brand {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
}

.gheader__brand:hover {
  text-decoration: none;
}

/* 768px 以上は、ロゴの欄を少なくともサイドメニューの幅にする。
   サイドメニューは中身の幅で決まるので、実際の幅を app.js が --w-sidebar-now に入れる */
@media (min-width: 768px) {
  /* 横に「業務ポータル」を置くので、欄はサイドメニューの幅を最小にし、ロゴ（高さ --h-logo のまま）と
     文字の分だけ広げる */
  .gheader__brand {
    flex: 0 0 auto;
    min-width: var(--w-sidebar-now, var(--w-sidebar));
    box-sizing: border-box;
  }

  /* サイドメニューは中身の幅に縮める。長い語があれば今までの幅（--w-sidebar）まで広げ、それ以上は … で切る */
  .sidebar:not(.is-collapsed) {
    flex: 0 0 auto;
    width: max-content;
    min-width: var(--w-sidebar-narrow);
    max-width: var(--w-sidebar);
  }
}

/* 公式サイト（cityinmobara.com）のスマホのメニューの白ロゴ（372×44、透過）をそのまま使う */
.gheader__logo {
  display: block;
  height: var(--h-logo);
  width: auto;
  flex: 0 0 auto;
}

/* ロゴの横の「業務ポータル」。ロゴより小さく、白を少し落とす。狭い画面ではロゴだけにする */
.gheader__portal {
  flex: 0 0 auto;
  margin-left: var(--sp-2);
  color: var(--c-on-dark-sub);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.gheader__spacer {
  flex: 1 1 auto;
}

.gheader__right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.gheader__logout.btn-ghost {
  color: var(--c-text-inv);
  border-color: var(--c-on-dark-stroke);
}

.gheader__logout.btn-ghost:not(:disabled):hover {
  background: var(--c-on-dark-fill-hover);
}

/* ログイン中のユーザー。右端まで伸ばし、押す・乗せると真下にログアウトのメニューを出す */
.gheader__account {
  position: relative;
  display: flex;
  align-self: stretch;
}

.gheader__user {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  background: none;
  border: 0;
  border-left: 1px solid var(--c-on-dark-sep);
  color: var(--c-text-inv);
  font: inherit;
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
}

.gheader__username {
  font-weight: 600;
}

.gheader__account:hover .gheader__user,
.gheader__account:focus-within .gheader__user,
.gheader__account.is-open .gheader__user {
  background: var(--c-header-bg-dark);
}

/* 名前の地と同じ色で、名前と同じ幅のまま真下に伸びる。
   ドロップダウンなので影を使う（DESIGN.md §0-2 の例外） */
.gheader__menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: max-content;
  min-width: max(100%, var(--w-account));
  padding: var(--sp-1) 0;
  background: var(--c-header-bg-dark);
  box-shadow: var(--shadow-pop);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-menu) ease-out, visibility 0s linear var(--dur-menu);
}

.gheader__account:hover .gheader__menu,
.gheader__account:focus-within .gheader__menu,
.gheader__account.is-open .gheader__menu {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-menu) ease-out, visibility 0s;
}

.gheader__menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  color: var(--c-text-inv);
  font-size: var(--fs-sm);
  white-space: nowrap;
  text-decoration: none;
}

.gheader__menu-icon {
  flex: 0 0 auto;
  width: var(--sz-menuicon);
  height: var(--sz-menuicon);
}

.gheader__menu-item:hover {
  background: var(--c-on-dark-fill-hover);
  text-decoration: none;
}

/* 文字の大きさ（小・標準・大）。選んだものは白地に焦茶の文字 */
.gheader__fontsize {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--c-on-dark-sep);
  font-size: var(--fs-xs);
  color: var(--c-on-dark-sub);
}

.gheader__fontsize-options {
  display: flex;
}

.gheader__fontsize-btn {
  flex: 1 1 0;
  height: var(--h-btn-sm);
  padding: 0 var(--sp-2);
  background: none;
  border: 1px solid var(--c-on-dark-stroke);
  color: var(--c-text-inv);
  font: inherit;
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
}

.gheader__fontsize-btn + .gheader__fontsize-btn {
  border-left: 0;
}

.gheader__fontsize-btn:first-child {
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}

.gheader__fontsize-btn:last-child {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.gheader__fontsize-btn:hover {
  background: var(--c-on-dark-fill-hover);
}

.gheader__fontsize-btn[aria-pressed="true"] {
  background: var(--c-bg);
  color: var(--c-header-bg);
  font-weight: 600;
}

/* 名前の後ろに、権限の雛形をラベルのように添える */
.gheader__userrole {
  padding: 0 var(--sp-1);
  border: 1px solid var(--c-on-dark-stroke);
  border-radius: var(--r-sm);
  font-size: var(--fs-2xs);
  line-height: 1.6;
  color: var(--c-on-dark-sub);
}

/* --- デモの切り替え（DESIGN.md 4.27。dev とローカルだけ） ---------------- */
.gheader__demo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  font-size: var(--fs-sm);
}

/* 広い画面だけ語を出す。狭い画面はセレクトの aria-label で読む */
.gheader__demo-label {
  white-space: nowrap;
  color: var(--c-on-dark-sub);
}

.gheader__demo-select {
  height: var(--h-btn-sm);
  max-width: var(--w-demo-select);
  min-width: 0;
  padding: 0 var(--sp-2);
  border: 1px solid var(--c-on-dark-stroke);
  border-radius: var(--r-sm);
  background: var(--c-on-dark-fill);
  color: var(--c-text-inv);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
}

.gheader__demo-select:hover {
  background: var(--c-on-dark-fill-hover);
}

/* 開いた一覧は白地に本文色（焦茶の地の白文字のままにしない） */
.gheader__demo-select option,
.gheader__demo-select optgroup {
  background: var(--c-bg);
  color: var(--c-text);
}

@media (max-width: 1279px) {
  .gheader__demo-label {
    display: none;
  }
}

/* 切り替え中の帯。ヘッダーのすぐ下に全幅で出し、本文と一緒に流さない */
.demobanner {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-demo);
  color: var(--c-text-inv);
  font-size: var(--fs-md);
}

.demobanner__text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.demobanner__form {
  flex: 0 0 auto;
}

.demobanner__return {
  background: var(--c-bg);
  border-color: var(--c-bg);
  color: var(--c-demo);
}

.demobanner__return:not(:disabled):hover {
  background: var(--c-demo-pale);
}

/* --- 本体（サイドバー + メイン） --------------------------------------- */
.body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  flex: 0 0 var(--w-sidebar);
  width: var(--w-sidebar);
  background: var(--c-bg);
  border-right: 1px solid var(--c-border);
  padding: var(--sp-3) 0 0;
  overflow-y: auto;      /* 項目が増えてもサイドバー内だけでスクロールする */
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  /* たたむ・開く、お気に入りで幅が変わる（app.js が px で渡す）ときに、ぬるっと動かす */
  transition: flex-basis var(--dur-slide) ease-in-out, width var(--dur-slide) ease-in-out;
}

/* たたんだ状態。アイコンだけになる */
.sidebar.is-collapsed {
  flex-basis: var(--w-sidebar-min);
  width: var(--w-sidebar-min);
}

.sidebar__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar.is-collapsed .sidebar__text,
.sidebar.is-collapsed .sidebar__label {
  display: none;
}

.sidebar.is-collapsed .sidebar__item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  position: relative;
}

.sidebar.is-collapsed .sidebar__badge {
  position: absolute;
  top: 4px;
  right: 8px;
  margin-left: 0;
}

.sidebar.is-collapsed .sidebar__collapse {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar.is-collapsed .sidebar__collapse svg {
  transform: rotate(180deg);
}

.sidebar__label {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
  letter-spacing: 0.06em;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  color: var(--c-text);
  font-size: var(--fs-md);
  text-decoration: none;
}

.sidebar__item:hover {
  background: var(--c-row-hover);
  text-decoration: none;
}

/* 選んでいる項目は地の色と文字で示す（左の帯は付けない） */
.sidebar__item.is-active {
  background: var(--c-brand-pale);
  color: var(--c-brand-dark);
  font-weight: 600;
}

/* マスタ管理などのグループ。details/summary で開閉する */
.sidebar__group > summary {
  cursor: pointer;
  list-style: none;
}

.sidebar__group > summary::-webkit-details-marker {
  display: none;
}

.sidebar__chevron {
  margin-left: auto;
  width: var(--sp-2);
  height: var(--sp-2);
  border-right: 2px solid var(--c-text-sub);
  border-bottom: 2px solid var(--c-text-sub);
  /* 四角を回した ∨ は、線が四角の下半分に寄るので、字の見た目の真ん中まで上げる */
  transform: translateY(calc(var(--sp-2) * -0.4)) rotate(45deg);
}

/* 閉じたグループの子も幅には数える（高さは 0 で見せない）。数えないと、グループを開くたびに
   サイドバーの幅（中身の幅に合わせる）が変わる */
.sidebar__group::details-content {
  content-visibility: visible;
  display: block;
  block-size: 0;
  overflow: hidden;
  /* 開け閉めは高さをなめらかに変えて、下へスライドさせる */
  transition: block-size var(--dur-slide) ease-in-out;
}

/* 読み込んだときは、覚えた開け閉めの状態をスライドさせずに当てる（_shell.html が最初の描画の後に
   is-ready を付ける）。付けないと、閉じた所から開いて見える */
.sidebar:not(.is-ready) .sidebar__group::details-content {
  transition: none;
}

.sidebar__group[open]::details-content {
  block-size: auto;
}

/* 高さ auto へのスライドに使う */
.sidebar {
  interpolate-size: allow-keywords;
}

/* 開いたとき（∧）は線が上半分に寄るので、下げる */
.sidebar__group[open] > summary .sidebar__chevron {
  transform: translateY(calc(var(--sp-2) * 0.1)) rotate(-135deg);
}

.sidebar__item--child {
  padding-left: var(--sp-6);
}

/* グループの見出しの件数（子の件数の合計）。開いているときは子の件数だけを見せる */
.sidebar__group[open] > summary .sidebar__badge--group {
  display: none;
}

.sidebar__badge--group + .sidebar__chevron {
  margin-left: var(--sp-2);
}

/* たたんだときも子はアイコンだけで残す（文字は .sidebar__text ごと隠れる） */
.sidebar.is-collapsed .sidebar__chevron {
  display: none;
}

.sidebar__icon {
  flex: 0 0 auto;
  width: var(--sz-navicon);
  height: var(--sz-navicon);
  display: block;
  color: var(--c-text-sub);
  transform: translateY(var(--nudge-icon));   /* 字の見た目の真ん中にそろえる */
}

.sidebar__item.is-active .sidebar__icon {
  color: var(--c-brand);
}

/* --- サブメニュー（アンケートの回答画面など） --------------------------- */
/* 開閉ボタン。サイドバーの最下部に置く */
.sidebar__collapse {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: none;
  border: 0;
  border-top: 1px solid var(--c-border-light);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
  text-align: left;
  flex: 0 0 auto;
}

.sidebar__collapse:hover {
  background: var(--c-row-hover);
  color: var(--c-text);
}

.sidebar__collapse svg {
  flex: 0 0 auto;
  width: var(--sz-navicon);
  height: var(--sz-navicon);
  transition: transform 0.15s ease;
}

.sidebar__badge {
  margin-left: auto;
  min-width: 18px;
  padding: 0 var(--sp-1);
  background: var(--c-st-ng);
  color: var(--c-text-inv);
  border-radius: 9px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-align: center;
  line-height: 18px;
}

/* 未読の数の丸（nav-badge.js）は、出していないときも場所を取っておく。
   出る・出ないでサイドメニューの幅（中身の幅で決まる）が変わらないように */
.sidebar__badge[data-unread-badge][hidden],
.sidebar__badge[data-status-badge][hidden] {
  display: inline-block;
  visibility: hidden;
}

/* 「近日公開」配下の項目。使えることは分かるが、今すぐ使う項目と混ざらない濃さにする。 */
.sidebar__item--soon {
  opacity: 0.55;
}

.sidebar__item--soon:hover {
  opacity: 0.85;
}

/* 試作を開く画面（templates/prototype.html）。上に帯、残りを iframe の試作にあてる。 */
.protoview {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.protoview__banner {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-st-draft-bg);
  color: var(--c-st-draft-ink);
  border-bottom: 1px solid var(--c-st-draft);
  font-size: var(--fs-sm);
}

.protoview__back {
  color: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.protoview__frame {
  flex: 1;
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  background: var(--c-bg);
}

.sidebar__sep {
  margin: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--c-border-light);
}

/* --- メイン ------------------------------------------------------------ */
.main {
  flex: 1 1 auto;
  min-width: 0;
  --main-pad-bottom: var(--sp-6);  /* 下に止める操作帯（.formfoot--sticky）が打ち消す */
  --main-pad-x: var(--sp-5);       /* 左右の余白。下に止める操作帯はこの分だけ広げて端まで届かせる */
  padding: var(--sp-4) var(--main-pad-x) var(--main-pad-bottom);
  overflow: auto;        /* スクロールするのはここだけ */
  /* 中の position: absolute（読み上げ用に見えなくしたラベルなど）の基準をここにする。無いと body が基準に
     なって .main の枠から外れ、ページ全体が伸びて 2 本目のスクロールバーと下の空白が出る */
  position: relative;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.crumbs a {
  color: var(--c-text-sub);
}

/* 項目の中で折り返さない。長い最後の項目（件名など）は、はみ出す分を「…」で切る */
.crumbs { min-width: 0; }
.crumbs > a, .crumbs > span { flex: none; white-space: nowrap; }
.crumbs > span:last-of-type { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.crumbs > * + *::before {
  display: inline-block;
  content: "/";
  margin-right: var(--sp-2);
  color: var(--c-border-strong);
}

/* ボタンの有無で高さが変わると、画面を移るたびにタイトルが上下にずれる。
   min-height で固定し、常に同じ位置に来るようにする。 */
.pagehead {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--h-pagehead);
  margin-bottom: var(--sp-4);
}

.pagehead__title {
  font-size: var(--fs-xl);
  font-weight: 700;
}

.pagehead__sub {
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.pagehead__actions {
  margin-left: auto;
  display: flex;
  gap: var(--sp-2);
}

/* 画面の見出しの右のボタンは、どの画面もふだんのボタンの大きさ（--h-btn）にそろえる。
   小さいボタン（--h-btn-sm）では押しにくく、見出しに対して小さすぎた（2026-11-03 ユーザー）。
   切り替え（.fmap-switch）も同じ高さにする（枠の 1px を上下で引く） */
.pagehead__actions .btn {
  height: var(--h-btn);
  padding: calc(var(--sp-hair) * 2) var(--sp-4) 0;   /* .btn と同じ（字を 1px 下げる） */
  font-size: var(--fs-md);
}

.pagehead__actions .btn svg {
  transform: translateY(calc(var(--sp-hair) * -1));  /* .btn と同じ（btn--sm の上書きを戻す） */
}

.pagehead__actions .fmap-switch__item {
  height: calc(var(--h-btn) - 2px);
  padding: 0 var(--sp-4);
  font-size: var(--fs-md);
}

/* --- ログイン ---------------------------------------------------------- */
/* サイドバーを持たない画面。ヘッダーの帯だけを残し、下の余白に面を 1 枚置く。
   .main は左上から流す枡なので、中央に置く枡を別に持つ。 */
.signin {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  display: grid;
  justify-items: center;
  align-content: center;
  /* 面が余白より高いとき、中央寄せは上端を画面の外に出して戻せなくする。
     safe を解さないブラウザでは上の center が残るよう、順に書く。 */
  align-content: safe center;
  padding: var(--sp-6) var(--sp-5);
}

/* 面の中の欄やボタンは display を持つので、hidden を必ず効かせる（送る前のコードの欄などを隠す） */
.signin [hidden] {
  display: none;
}

/* 入れるものは少ない。読みやすい幅で止め、横に伸ばさない */
.signin__box {
  width: min(360px, 100%);
}

/* 面の中の説明。見出しと同じ寸法では階層が潰れるので、補足の寸法に落とす */
.signin__lead {
  margin-bottom: var(--sp-3);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

/* この画面の操作は 1 つだけである。面の幅いっぱいで受ける */
.signin__actions {
  margin-top: var(--sp-3);
}

.signin__actions .btn {
  width: 100%;
}

.signin__panel .fieldrow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}

.signin__panel .fieldrow > label {
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* 面の上のホテルの名前。ヘッダーのロゴと同じく、どこの入口かを最初に示す */
.signin__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
}

/* 公式サイトの縦組みのロゴ（白地の JPEG）。地の白を乗算で消し、ページの地色になじませる */
.signin__logo {
  display: block;
  height: var(--h-signin-logo);
  width: auto;
  mix-blend-mode: multiply;
}

.signin__portal {
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

/* 入力の面。見出しの帯は付けない（操作が 1 つだけの面なので、帯は情報にならない） */
.signin__card {
  padding: var(--sp-5);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}

.signin__field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
}

.signin__field label {
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* ラベルの右に「忘れた場合」を寄せる */
.signin__labelrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* 文字だけの操作（忘れた場合、ほかの方法、戻る）。ボタンの形にせず、リンクの色で示す */
.signin__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-brand);
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-sm);
}

.signin__link:hover {
  color: var(--c-brand-dark);
}

/* ほかの方法は、主の操作の下に細い線で区切って控えめに並べる */
.signin__others {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-1) var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

.signin__hint {
  margin: 0 0 var(--sp-2);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

/* 送ったコードの入力の下の補足（届かないとき） */
.signin__form + .signin__hint {
  margin: var(--sp-3) 0 0;
}

/* 「コードを送り直す」は小さなフォームのボタン。リンクと同じ並びに置く */
.signin__others form {
  display: inline;
}

/* 開発ログイン（ローカルだけ）。本物の入口と混ざらないよう、破線で区切って下に置く */
.signin__dev {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--c-border);
}

.signin__error {
  margin-top: var(--sp-2);
  color: var(--c-st-ng);
  font-size: var(--fs-sm);
}

.signin__subpanel .signin__actions:first-of-type {
  margin-top: 0;
}

/* 認証アプリの登録 (GLIQ-552)。手順は番号で並べ、QR コードは面の中央に置く */
.signin__steps {
  margin: 0 0 var(--sp-3);
  padding-left: 1.4em;
  font-size: var(--fs-sm);
}

.signin__steps li + li {
  margin-top: var(--sp-1);
}

/* QR コードは白地で、読み取りに要る周りの余白ごと置く。幅は面に合わせて縮む */
.signin__qr {
  display: grid;
  justify-items: center;
  margin: 0 0 var(--sp-3);
}

.signin__qr-image {
  display: block;
  width: min(200px, 100%);
  height: auto;
  background: #fff;
}

.signin__secret {
  margin: 0 0 var(--sp-3);
  text-align: center;
}

.signin__secret summary {
  display: inline;
  list-style: none;
}

.signin__secret summary::-webkit-details-marker {
  display: none;
}

.signin__secret[open] .signin__hint {
  margin-top: var(--sp-2);
  text-align: left;
}

/* 合言葉は 4 文字ずつに分け、1 と l、0 と O を取り違えないよう等幅で出す */
.signin__secret-text {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-lg);
  letter-spacing: 0.05em;
  word-spacing: 0.4em;
  overflow-wrap: anywhere;
  user-select: all;
}

/* --- セクション -------------------------------------------------------- */
.panel {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
}

.panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-th-bg);
  border-bottom: 1px solid var(--c-border);
  border-radius: var(--r-md-inner) var(--r-md-inner) 0 0;   /* 欄の枠の内側。枠と同じ丸みだと角に白いすき間が出る */
  font-size: var(--fs-md);
  font-weight: 600;
}

.panel__head .u-sub {
  font-weight: 400;
}

.panel__sub {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--c-text-sub);
  /* 小さい字を大きい題と箱の中央でそろえると、字の見た目の真ん中が下に来る（2x で 3px 前後）。
     題の字の見た目の真ん中に合わせて持ち上げる */
  transform: translateY(calc(var(--sp-hair) * -1.5));
}

.panel__title-lg {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.panel__actions {
  margin-left: auto;
  display: flex;
  gap: var(--sp-2);
}

.panel__body {
  padding: var(--sp-3);
}

.panel__body--flush {
  padding: 0;
}

/* 欄のいちばん下に表を置いたとき、表が欄の下の角の丸めを隠さないよう切る。
   hidden だと見出しの sticky が効かなくなるので clip にする */
.panel__body--flush:last-child {
  border-radius: 0 0 var(--r-md-inner) var(--r-md-inner);
  overflow: clip;
}

/* 欄の中に端まで置いた表は、表の外側の罫線を描かない（欄の枠・見出しの帯・下の帯の線と二重になり、
   下の角では四角い罫線が丸い枠からはみ出す） */
.panel__body--flush .dtable {
  border-style: hidden;
}

.panel__body--flush .dtable--sticky tr > :first-child {
  border-left-width: 0;
}

.panel__body--flush .dtable--sticky tr > :last-child {
  border-right-width: 0;
}

.panel__body--flush .dtable--sticky thead th {
  border-top-width: 0;
}

.panel__body--flush .dtable--sticky tbody tr:last-child > * {
  border-bottom-width: 0;
}

/* 表の下の帯。見出しの帯と同じ地と高さで、ページャーを置く（無ければ空のまま） */
.panel__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: calc(var(--fs-md) * 1.6 + var(--sp-2) * 2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-th-bg);
  border-top: 1px solid var(--c-border);
  border-radius: 0 0 var(--r-md-inner) var(--r-md-inner);
  font-size: var(--fs-sm);
}

/* --- グリッド ---------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar-right { grid-template-columns: minmax(0, 1fr) 320px; align-items: stretch; }

/* --- フッター（画面右下のアクション） ----------------------------------- */
.formfoot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--c-bg-sub);
  border-top: 1px solid var(--c-border);
}

/* フッターに並ぶボタンは高さと文字の大きさを揃える。
   主役の「承認」だけ btn--lg の min-width で幅が広くなる。 */
.formfoot .btn {
  height: var(--h-btn-lg);
  font-size: var(--fs-lg);
}

.formfoot__left {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.formfoot__right {
  display: flex;
  gap: var(--sp-2);
}

/* 上段（ボタンの上に出す案内）。帯の幅いっぱいに取る */
.formfoot__top {
  flex: 1 0 100%;
}

.formfoot__top:not(:has(> :not([hidden]))) {
  display: none;
}

.formfoot__top .note {
  margin: 0;
}

/* 画面の下に止める操作帯。影は使わず、上の罫線と地の色で区切る（§0-2）。
   高さは --h-actionbar（トーストはこの上に出す） */
.formfoot--sticky {
  position: sticky;
  /* .main の下の余白の分だけ下げ、画面の下端に付ける。左右も .main の余白の分だけ広げて端まで届かせる */
  bottom: calc(var(--main-pad-bottom) * -1);
  margin-left: calc(var(--main-pad-x) * -1);
  margin-right: calc(var(--main-pad-x) * -1);
  /* 上は中身（プレビューの電話など）とくっつけない。下は .main の余白を打ち消し、
     いちばん下までスクロールしても帯の下に隙間を空けない */
  margin-top: var(--sp-4);
  margin-bottom: calc(var(--main-pad-bottom) * -1);
  padding-left: var(--main-pad-x);
  padding-right: var(--main-pad-x);
  z-index: var(--z-actionbar);
  flex-wrap: wrap;
  min-height: var(--h-actionbar);
  border-top: 1px solid var(--c-border-strong);
}

/* キーボードで次の欄へ移ったとき、帯の裏に隠れないよう余白を取ってスクロールする */
.main:has(.formfoot--sticky) {
  scroll-padding-bottom: calc(var(--h-actionbar) + var(--sp-3));
}

/* --- ナビドロワーの背景 ------------------------------------------------ */
.navbackdrop {
  display: none;
}

/* --- レスポンシブ（768px 未満） --------------------------------------- */
@media (max-width: 767px) {
  /* ロゴの横の「業務ポータル」は出さない（ロゴだけ） */
  .gheader__portal {
    display: none;
  }

  /* ドロワーの項目は、詰めても押しやすい高さは残す */
  .sidebar__item {
    min-height: var(--h-tap);
  }

  .gheader__menu-btn {
    display: inline-flex;
  }

  .gheader__userrole {
    display: none;
  }

  /* 390px でログアウトが画面の外に出ないよう、ロゴは縮め、名前は短く切ってラベルは隠す */
  .gheader__brand {
    flex: 0 1 auto;
    min-width: 0;
    padding: 0 var(--sp-3);
  }

  .gheader__logo {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    height: auto;
    max-height: var(--h-logo);
  }

  .gheader__username {
    max-width: var(--w-header-name-mobile);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gheader__right {
    gap: var(--sp-2);
  }

  .gheader__user {
    padding: 0 var(--sp-3);
  }

  /* デモの切り替えは幅を詰める。iOS が拡大しないよう文字は 16px */
  .gheader__demo-select {
    max-width: var(--w-demo-select-mobile);
    font-size: var(--fs-input-mobile);
  }

  .demobanner {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-sm);
  }

  .body {
    position: relative;
  }

  .sidebar {
    position: fixed;
    top: var(--h-header);
    left: 0;
    bottom: 0;
    z-index: var(--z-dropdown);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-pop);
  }

  .app.is-nav-open .sidebar {
    transform: translateX(0);
  }

  .navbackdrop {
    position: fixed;
    top: var(--h-header);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: calc(var(--z-dropdown) - 1);
    background: var(--c-shade);
  }

  .app.is-nav-open .navbackdrop {
    display: block;
  }

  .sidebar__collapse {
    display: none;
  }

  .main {
    --main-pad-bottom: var(--sp-3);
    --main-pad-x: var(--sp-3);
    padding: var(--sp-3);
  }

  .signin {
    padding: var(--sp-4) var(--sp-3);
  }

  .pagehead {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    gap: var(--sp-2);
  }

  .pagehead__actions {
    margin-left: 0;
    flex-wrap: wrap;
    padding-bottom: 0;
  }

}

/* --- 画面の移り変わり ---------------------------------------------------- */
/* 画面を開いたとき、中身だけをフェードインで出す。
   ヘッダー、サイドバー、パンくず、タイトル、タブの段は動かさない（タブを移っても同じ部分は止まって見える）。
   .main 自体は保存のあとの差し替え（app.js の softRefresh）でも残るので、印（td-shown）は一度だけ付く。
   View Transitions は、グラフのある画面などから移るとブラウザが取りやめることが多いので使わない */
/* 待機画面（.intake-wait）にも掛けない。透けると、覆っているはずのフォームが一瞬見える */
/* 必読を重ねたあなたへの連絡（.mestage.has-required）にも掛けない。透けているあいだはぼかしの基準が変わり、
   フェードの終わりにぼかしが描き直されて、左上が一瞬ずれて見える（重ねの中身だけを components.css でフェードさせる） */
.main:not(.td-shown) > :not(.crumbs):not(.pagehead):not(.tabs):not(.intake-wait):not(.mestage.has-required) {
  animation: td-page-in var(--dur-page) ease-in-out both;
}

@keyframes td-page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- 右に並べて表示 ------------------------------------------------------- */
/* 管理画面の別のページを右のパネル（iframe）に開く。左の境目をドラッグして幅を変える。
   広い画面（1200px 以上）だけ。パネルの中のページ（.is-embed）はヘッダーとサイドバーを出さない */
.split {
  position: relative;
  display: flex;
  flex: 0 0 var(--w-split-now, var(--w-split));
  width: var(--w-split-now, var(--w-split));
  min-width: 0;
  border-left: 1px solid var(--c-border);
  background: var(--c-bg);
}

.split[hidden] {
  display: none;
}

/* 開け閉めのスライド（app.js の wireSplit）。枠の幅を 0 から広げ、中のページは今の幅のまま
   枠の左の端について動くので、右から入ってくるように見える（中のページの幅は変えない） */
.split {
  transition: flex-basis var(--dur-split) ease-in-out, width var(--dur-split) ease-in-out,
    border-left-color var(--dur-split) ease-in-out;
}

.split.is-sliding {
  overflow: hidden;
}

.split.is-sliding .split__pane {
  flex: 0 0 var(--w-split-now, var(--w-split));
  width: var(--w-split-now, var(--w-split));
  transition: opacity var(--dur-split) ease-in-out;
}

.split.is-shut {
  flex-basis: 0;
  width: 0;
  border-left-color: transparent;
}

.split.is-shut .split__pane {
  opacity: 0;
}

.split__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--sp-1) * -1);
  z-index: 2;
  width: var(--sp-2);
  cursor: col-resize;
}

.split__handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--sp-1) - 1px);
  width: 2px;
  background: var(--c-brand);
  opacity: 0;
  transition: opacity var(--dur-menu) ease-in-out;
}

.split__handle:hover::after,
.is-split-dragging .split__handle::after {
  opacity: 1;
}

.is-split-dragging {
  cursor: col-resize;
  user-select: none;
}

.is-split-dragging .split__frame {
  pointer-events: none;
}

/* 境目をドラッグしている間は、幅の動きを付けない（ドラッグに遅れてついてくる） */
.is-split-dragging .split {
  transition: none;
}

.split__pane {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.split__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: var(--h-btn);
  padding: 0 var(--sp-2) 0 var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-sub);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.split__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--h-btn-sm);
  height: var(--h-btn-sm);
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-text-sub);
  cursor: pointer;
}

.split__btn:hover {
  background: var(--c-row-hover);
  color: var(--c-text);
}

.split__btn svg {
  width: var(--sz-menuicon);
  height: var(--sz-menuicon);
}

.split__frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: var(--c-bg-sub);
}

/* ページを選ぶ一覧。iframe の上に重ねる */
.split__picker {
  position: absolute;
  top: var(--h-btn);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  overflow: auto;
  padding: var(--sp-2);
  background: var(--c-bg);
}

.split__picker[hidden] {
  display: none;
}

/* 一覧の出方: 上から少し滑ってふわっと出て、項目は上から順に遅れて出る。閉じるときは上へ引きながら消える */
.split__picker:not([hidden]) {
  animation: split-picker-in var(--dur-dropdown) ease-in-out;
}

/* 閉じるときは開くときの逆: 下の項目から順に上へ引きながら消え、最後に一覧の地が消える */
.split__picker.is-closing {
  animation: split-picker-out var(--dur-dropdown) ease-in-out forwards;
  animation-delay: calc(var(--dur-dropdown) * 0.06 * var(--n, 0));
}

.split__picker.is-closing .split__pick {
  animation: split-pick-out var(--dur-dropdown) ease-in-out both;
  animation-delay: calc(var(--dur-dropdown) * 0.06 * (var(--n, 0) - 1 - var(--i, 0)));
}

.split__picker:not(.is-closing) .split__pick {
  animation: split-pick-in var(--dur-dropdown) ease-in-out both;
  animation-delay: calc(var(--dur-dropdown) * 0.12 * var(--i, 0));
}

@keyframes split-picker-in {
  from {
    opacity: 0;
    transform: translateY(calc(var(--sp-2) * -1));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes split-picker-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(calc(var(--sp-2) * -1));
  }
}

@keyframes split-pick-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(calc(var(--sp-2) * -1));
  }
}

@keyframes split-pick-in {
  from {
    opacity: 0;
    transform: translateY(calc(var(--sp-2) * -1));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .split__picker:not([hidden]),
  .split__picker.is-closing,
  .split__picker .split__pick {
    animation: none;
  }
}

.split__pick {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--c-text);
  font-size: var(--fs-md);
  text-decoration: none;
}

.split__pick:hover {
  background: var(--c-row-hover);
  text-decoration: none;
}

/* サイドバーの項目にホバーで重ねる「右に開く」。項目の右端に置き、サイドバーの幅は変えない */
.sidebar__item {
  position: relative;
}

.sidebar__split {
  position: absolute;
  top: 50%;
  /* 件数の赤い丸（項目の右の余白 --sp-4 に右端、最小幅 18px）と同じ中心に置き、乗せたときにその場で入れ替わる
     ように見せる。丸の中心は右端から --sp-4 + 9px、この押せる広さの半分は 11px */
  right: calc(var(--sp-4) - var(--sp-hair) * 2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sz-split-open);
  height: var(--sz-split-open);
  color: var(--c-text-mute);
  opacity: 0;
  transform: translateY(-50%);   /* 丸と同じ、項目の上下の真ん中 */
  transition: opacity var(--dur-menu) ease-in-out, color var(--dur-menu) ease-in-out;
}

/* さりげなく: 背景の四角は付けず、小さく薄い線だけ。項目にホバーしたときにふわっと出す */
.sidebar__split svg {
  width: var(--sz-split-icon);
  height: var(--sz-split-icon);
}

.sidebar__item:hover .sidebar__split {
  opacity: 1;
}

.sidebar__split:hover {
  color: var(--c-brand-dark);
}

/* 件数の赤い丸は項目の右端にあり、「右に開く」と同じ所に来る。項目にマウスを乗せている間だけ、丸を
   ふわっと消して入れ替える（幅は変えない。離すと戻る） */
.sidebar__badge {
  transition: opacity var(--dur-menu) ease-in-out, transform var(--dur-menu) ease-in-out;
}

.sidebar:not(.is-collapsed) .sidebar__item:has(> .sidebar__split):hover > .sidebar__badge {
  opacity: 0;
  transform: scale(0.6);
}

.sidebar.is-collapsed .sidebar__split {
  display: none !important;
}

.gheader__split-state {
  margin-left: auto;
  padding-left: var(--sp-3);
  color: var(--c-on-dark-sub);
  font-size: var(--fs-xs);
}

.gheader__split[aria-pressed="true"] .gheader__split-state {
  color: var(--c-text-inv);
  font-weight: 600;
}

button.gheader__menu-item {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
}

/* 狭い画面では並べない（左が狭くなりすぎる） */
@media (max-width: 1199px) {
  .split,
  .gheader__split,
  .sidebar__split {
    display: none !important;
  }
}

/* パネルの中のページ。ヘッダー、サイドバー、デモの帯、パネル自身は出さない */
.is-embed .gheader,
.is-embed .sidebar,
.is-embed .demobanner,
.is-embed .navbackdrop,
.is-embed .split {
  display: none !important;
}

.is-embed .app {
  min-width: 0;
}

/* --- サイドバーの階層を読みやすく（2026-10-11） ------------------------ */
/* グループの見出しは太く、子は一回り小さく。子の長い名前は切らずに折り返す（「月次の見込みの入力」） */
.sidebar__group > summary.sidebar__item {
  font-weight: 600;
}

.sidebar__item--child {
  font-size: var(--fs-sm);
  padding-top: calc(var(--sp-2) * 0.75);
  padding-bottom: calc(var(--sp-2) * 0.75);
}

.sidebar__item--child .sidebar__text {
  white-space: normal;
  line-height: 1.3;
}

.sidebar__item--child .sidebar__icon {
  width: calc(var(--sz-navicon) * 0.85);
  height: calc(var(--sz-navicon) * 0.85);
}

/* 開いている画面を含むグループは、見出しにも色を付ける */
.sidebar__group > summary.sidebar__item.is-current {
  color: var(--c-brand-dark);
}

.sidebar__group > summary.is-current .sidebar__icon {
  color: var(--c-brand);
}

/* グループのあいだに少し間を空ける */
.sidebar__group + .sidebar__group {
  margin-top: var(--sp-1);
}

/* 近日公開のまとまり。見出しは薄く小さく、ふだんはたたんでおく */
.sidebar__group--soon > summary.sidebar__item {
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
  letter-spacing: 0.06em;
}

.sidebar.is-collapsed .sidebar__group--soon {
  display: none;
}
