html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  margin: 0;
  box-sizing: border-box;
}

:root {
  --font-sans:
    "Noto Sans JP", ui-sans-serif, system-ui, -apple-system, "Hiragino Sans",
    "Yu Gothic", "Meiryo", sans-serif;
  /* ハンバーガー全画面オーバーレイの開始位置（ヘッダーは常に表示） */
  --app-header-height: calc(100vw * 48 / 375);
  /* 主要ブロック間の標準的な縦余白（セクション間）。ページ CSS で必要に応じて使用 */
  --app-section-gap: calc(100vw * 20 / 375);
  --app-btn-shadow:
    0 calc(100vw * 3 / 375) calc(100vw * 4 / 375) rgba(17, 24, 39, 0.06),
    0 calc(100vw * 6 / 375) calc(100vw * 14 / 375) rgba(17, 24, 39, 0.1),
    0 calc(100vw * 10 / 375) calc(100vw * 22 / 375) rgba(17, 24, 39, 0.12);
  --app-btn-shadow-hover:
    0 calc(100vw * 4 / 375) calc(100vw * 6 / 375) rgba(17, 24, 39, 0.08),
    0 calc(100vw * 8 / 375) calc(100vw * 18 / 375) rgba(17, 24, 39, 0.12),
    0 calc(100vw * 14 / 375) calc(100vw * 28 / 375) rgba(17, 24, 39, 0.14);
}

body {
  font-family: var(--font-sans);
}

/* ========================================
   ベースレイアウト
========================================= */

/* 全体 */
body.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #f9fafb;
  color: #182c5b;
}

/* ========================================
   Header
========================================= */

.app_header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  align-self: stretch;
  flex-shrink: 0;
  z-index: 1205;
  width: 100%;
  min-height: calc(100vw * 48 / 375);
  border-bottom: calc(100vw * 1 / 375) solid rgba(17, 24, 39, 0.1);
  background-color: #ed7051;
}

/* ヘッダーを fixed にした分の余白（管理シェルでは app_header を非表示のため対象外）。
   各ページの .app_main { padding: 0 } が後勝ちするため padding-top のみ !important */
body.app:not(.admin_shell_page) > main.app_main {
  padding-top: var(--app-header-height) !important;
}

/* ========================================
   ハンバーガーボタン
========================================= */

.hamburger {
  position: absolute;
  top: calc(100vw * 12 / 375);
  left: calc(100vw * 16 / 375);
  z-index: 1201;
  width: calc(100vw * 32 / 375);
  height: calc(100vw * 24 / 375);
  border: none;
  background: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 100%;
  height: calc(100vw * 3 / 375);
  margin: calc(100vw * 5 / 375) 0;
  border-radius: calc(100vw * 2 / 375);
  background: #ffffff;
  transition: all 0.3s ease;
}

/* × に変形 */
.hamburger.is-open span:nth-child(1) {
  transform: translateY(calc(100vw * 8 / 375)) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(calc(100vw * -8 / 375)) rotate(-45deg);
}

/* ========================================
   ハンバーガーメニュー
========================================= */

.hamburger_menu {
  position: fixed;
  top: var(--app-header-height);
  left: 0;
  z-index: 1200;
  width: 100%;
  height: calc(100vh - var(--app-header-height));
  height: calc(100dvh - var(--app-header-height));
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.hamburger_menu.is-open {
  visibility: visible;
  opacity: 1;
}

.hamburger_backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  border: 0;
  background: rgba(17, 24, 39, 0.28);
  cursor: pointer;
}

/* 外側モーダル: 243×523px（デザイン仕様）／パディング 20px → 内側 203×483 */
.hamburger_panel {
  --menu-navy: #939393;
  --hamburger-outer-w: calc(100vw * 243 / 375);
  --hamburger-outer-h: calc(100vw * 523 / 375);
  --hamburger-inner-w: calc(100vw * 203 / 375);
  --hamburger-inner-h: calc(100vw * 483 / 375);
  --hamburger-pad: calc(100vw * 20 / 375);
  position: absolute;
  /* 旧: 画面先頭から 58px（= ヘッダー 48px + 余白 10px）。オーバーレイがヘッダー下から始まるため 10px */
  top: calc(100vw * 10 / 375);
  bottom: calc(100vw * 12 / 375);
  left: calc(100vw * 10 / 375);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  width: min(var(--hamburger-outer-w), calc(100vw - calc(100vw * 12 / 375)));
  max-width: min(calc(100vw * 243 / 375), calc(100vw - calc(100vw * 12 / 375)));
  max-height: var(--hamburger-outer-h);
  height: auto;
  padding: var(--hamburger-pad);
  border: none;
  border-radius: calc(100vw * 8 / 375);
  box-shadow:
    calc(100vw * 4 / 375) calc(100vw * 6 / 375) calc(100vw * 18 / 375)
      rgba(17, 24, 39, 0.14),
    calc(100vw * 2 / 375) calc(100vw * 2 / 375) calc(100vw * 8 / 375)
      rgba(17, 24, 39, 0.08);
  background: #ffffff;
  transform: translateX(-100%) translateX(calc(100vw * -24 / 375));
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.hamburger_menu.is-open .hamburger_panel {
  transform: translateX(0);
}

/* 内側の枠付きボックス: 仕様どおり 203×483px／外側パディングに応じて伸縮 */
.hamburger_menu_list {
  list-style: none;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(var(--hamburger-inner-w), 100%);
  min-height: 0;
  max-height: var(--hamburger-inner-h);
  margin: 0;
  padding: 0;
  border: calc(100vw * 1 / 375) solid var(--menu-navy);
  border-radius: calc(100vw * 8 / 375);
  background: #ffffff;
}

.hamburger_menu_list li {
  flex-shrink: 0;
}

/* 区切り線は先頭 5 項目の間のみ（ログアウトの下には付けない） */
.hamburger_menu_list li:not(:last-child) {
  border-bottom: calc(100vw * 1 / 375) solid #e8eaed;
}

.hamburger_menu_list li:last-child {
  border-bottom: 0;
  margin-top: auto;
}

.hamburger_menu_list a {
  display: block;
  font-family: var(--font-sans);
  font-size: calc(100vw * 17 / 375);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #334155;
  padding: calc(100vw * 16 / 375) calc(100vw * 20 / 375);
}

/* 従業員メニュー（アイコン付きハンバーガー） */
.hamburger_menu_list a.employee_hamburger_link {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: calc(100vw * 52 / 375);
  gap: calc(100vw * 16 / 375);
  padding: calc(100vw * 14 / 375) calc(100vw * 12 / 375);
}

.employee_hamburger_icon_cell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: calc(100vw * 30 / 375);
  height: calc(100vw * 30 / 375);
}

.employee_hamburger_icon {
  display: block;
  flex-shrink: 0;
  width: calc(100vw * 20 / 375);
  height: calc(100vw * 20 / 375);
  object-fit: contain;
}

.employee_hamburger_icon.employee_hamburger_icon--menu_feature {
  width: calc(100vw * 30 / 375);
  height: calc(100vw * 30 / 375);
}

.employee_hamburger_label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  word-break: keep-all;
}

.app_header_inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw * 1200 / 375);
  height: calc(100vw * 48 / 375);
  margin: 0 auto;
  padding: 0 calc(100vw * 20 / 375);
}

.app_logo {
  font-size: calc(100vw * 24 / 375);
  font-weight: 700;
  color: #ffffff;
}

/* ========================================
   メイン
========================================= */

.app_main {
  flex: 1;
  width: 100%;
  max-width: calc(100vw * 1800 / 375);
  margin: 0 auto;
  padding: var(--app-section-gap);
  background: #f6f3f1;
}

/* ========================================
   フッター
========================================= */

.app_footer {
  background-color: #ed7051;
}

.app_footer_inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5vh;
}

.app_footer_inner a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(100vw * 10 / 375);
  font-size: calc(100vw * 16 / 375);
  text-decoration: none;
  color: #ffffff;
}

.app_footer_inner img {
  width: calc(100vw * 30 / 375);
}

/* SP 下部タブバー（全画面共通・区切り線 32px 高さ・縦中央） */
body.app .sp_tabbar > .sp_tabbar_item:not(:last-child) {
  position: relative;
}

body.app .sp_tabbar > .sp_tabbar_item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: calc(100vw * 1 / 375);
  height: calc(100vw * 32 / 375);
  background: rgba(255, 255, 255, 0.65);
  transform: translateY(-50%);
  pointer-events: none;
}

@media screen and (max-width: 768px) {
  .app_logo {
    font-size: calc(100vw * 20 / 375);
    color: #ffffff;
  }

  .hamburger_panel {
    left: 0;
    width: min(var(--hamburger-outer-w), calc(100vw - calc(100vw * 16 / 375)));
    max-width: min(
      calc(100vw * 243 / 375),
      calc(100vw - calc(100vw * 16 / 375))
    );
  }

  .hamburger_menu_list {
    border-radius: calc(100vw * 9 / 375);
  }

  .hamburger_menu_list a {
    font-size: calc(100vw * 16 / 375);
    padding: calc(100vw * 15 / 375) calc(100vw * 18 / 375);
  }
}
