/* partner サイト 共通スタイル（軽量） */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "メイリオ", sans-serif;
       background: #f8fafc; color: #1f2937; font-size: 14px; line-height: 1.55; }

a { color: #0284c7; text-decoration: none; }
a:hover { text-decoration: underline; }

/* topbar（PWA standalone：上部に貼り付け＋ノッチ safe-area 対応） */
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
          background: #fff; border-bottom: 1px solid #e5e7eb;
          position: sticky; top: 0; z-index: 40;
          padding: 10px 18px;
          padding-top: max(10px, env(safe-area-inset-top));
          padding-left: max(18px, env(safe-area-inset-left));
          padding-right: max(18px, env(safe-area-inset-right)); }
.topbar .brand { font-weight: 700; color: #0c4a6e; font-size: 15px; }
/* 横に長い時はナビだけ横スクロール（折返しで縦に伸びすぎない） */
.topnav { display: flex; gap: 4px; font-size: 13px; flex: 1 1 auto;
          overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: #475569; padding: 8px 12px; border-radius: 6px;
            display: inline-flex; align-items: center; min-height: 44px;
            white-space: nowrap; }
.topnav a:hover { background: #f1f5f9; text-decoration: none; }
.topnav a.active { background: #e0f2fe; color: #0c4a6e; font-weight: 700; }
.topbar .me { margin-left: auto; color: #6b7280; font-size: 13px; }
.topbar .logout button.link { background: none; border: none; color: #6b7280;
                              cursor: pointer; font-size: 13px; }
.topbar .logout button.link:hover { color: #ef4444; text-decoration: underline; }

/* ===== モバイル/PWA: ハンバーガーメニュー（jinzai desk と同じオフキャンバス・ドロワー） ===== */
/* PC幅では ☰ を出さず従来の横並びのまま（.nav-drawer は display:contents で透過）。
   狭い画面(≤640px)だけ、浮いた☰ピル＋左からスライドするドロワー＋暗幕に切替。 */
.nav-toggle { display: none; }            /* 既定(PC)は非表示 */
.nav-backdrop { display: none; }
.nav-drawer { display: contents; }        /* PC: 箱を作らず従来の横並びを維持 */

@media (max-width: 640px) {
  /* 浮いた☰ピル（固定・影つきで目立つ） */
  .topbar.has-hamburger .nav-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    position: fixed; z-index: 220;
    top: max(10px, env(safe-area-inset-top)); right: 12px;
    min-height: 42px; padding: 9px 16px; border: none; border-radius: 999px;
    background: #0c4a6e; color: #fff; font-weight: 700; font-size: 14px;
    cursor: pointer; user-select: none; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  }
  .topbar.has-hamburger .nav-toggle .lbl-close { display: none; }
  .topbar.has-hamburger .nav-toggle-cb:checked ~ .nav-toggle .lbl-open { display: none; }
  .topbar.has-hamburger .nav-toggle-cb:checked ~ .nav-toggle .lbl-close { display: inline; }

  /* 暗幕（チェック時に表示・タップで閉じる） */
  .topbar.has-hamburger .nav-backdrop {
    position: fixed; inset: 0; z-index: 190; background: rgba(0, 0, 0, 0.45);
  }
  .topbar.has-hamburger .nav-toggle-cb:checked ~ .nav-backdrop { display: block; }

  /* 左からのオフキャンバス・ドロワー */
  .topbar.has-hamburger .nav-drawer {
    display: flex; flex-direction: column; gap: 2px;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 82vw; max-width: 320px; z-index: 200;
    background: #fff; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
    padding: calc(58px + env(safe-area-inset-top)) 10px env(safe-area-inset-bottom);
    transform: translateX(-100%); transition: transform 0.25s ease;
  }
  .topbar.has-hamburger .nav-toggle-cb:checked ~ .nav-drawer { transform: translateX(0); }

  /* ドロワー内は縦メニュー（横スクロールを廃止） */
  .topbar.has-hamburger .topnav.nav-collapsible {
    display: flex; flex-direction: column; overflow: visible; gap: 2px; flex: none;
  }
  .topbar.has-hamburger .topnav.nav-collapsible a {
    min-height: 48px; padding: 12px 14px; border-radius: 8px; font-size: 15px;
  }

  /* 表示名・ログアウトはドロワー内に */
  .topbar.has-hamburger .me {
    margin: 8px 0 0; padding: 8px 14px 0; color: #6b7280;
  }
  .topbar.has-hamburger .logout {
    margin-top: 8px; border-top: 1px solid #e5e7eb; padding-top: 8px;
  }
  .topbar.has-hamburger .logout button.link {
    width: 100%; text-align: left; padding: 12px 14px; min-height: 48px;
  }
}

/* main */
/* community（admin.css の .content）と同じ横幅に揃える。委託者発行・対応依頼・
   キャリアアンケートなど横に長い表が多く、1080px だと横スクロールが出るため。 */
.content { max-width: 1600px; margin: 24px auto;
           padding: 0 max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-right)); }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
        padding: 18px 20px; margin-bottom: 14px; }
.card h2 { margin: 0 0 8px; font-size: 17px; }
.card h3 { margin: 0 0 8px; font-size: 14px; color: #475569; }
.card .big { font-size: 28px; font-weight: 700; margin: 4px 0 0; color: #0c4a6e; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.muted { color: #6b7280; }
.small { font-size: 12px; }

.grid-2 { display: grid; gap: 12px;
          grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.btn { display: inline-flex; align-items: center; justify-content: center;
       min-height: 40px; padding: 8px 14px; background: #0284c7;
       color: #fff; border-radius: 6px; font-size: 13px; font-weight: 600;
       border: none; cursor: pointer; margin-top: 6px; }
.btn:hover { background: #0369a1; text-decoration: none; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-outline { background: #fff; color: #0284c7; border: 1px solid #0284c7; }
.btn-outline:hover { background: #f0f9ff; color: #0c4a6e; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.flash-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }

table.grid { border-collapse: collapse; width: 100%; background: #fff; }
table.grid th, table.grid td { padding: 8px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; }
table.grid th { background: #f8fafc; font-size: 12px; color: #475569; }

/* auth (login) */
.c-auth { max-width: 380px; margin: 70px auto; padding: 0 16px; }
.c-auth h1 { font-size: 20px; margin-bottom: 4px; }
.c-auth .lead { color: #6b7280; font-size: 12px; margin: 0 0 18px; }
.c-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 22px 24px; }
.c-card label { display: block; font-size: 12px; font-weight: 600; margin: 12px 0 4px; }
.c-card label:first-of-type { margin-top: 0; }
.c-card input { width: 100%; box-sizing: border-box; padding: 9px 12px;
                border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.c-card input:focus { outline: none; border-color: #0284c7;
                      box-shadow: 0 0 0 3px rgba(2,132,199,0.15); }
.c-card button { width: 100%; margin-top: 16px; padding: 11px;
                 background: #0284c7; color: #fff; border: none; border-radius: 8px;
                 font-size: 14px; font-weight: 600; cursor: pointer; }
.c-card button:hover { background: #0369a1; }
.c-err { background: #fee2e2; color: #991b1b; padding: 10px 12px;
         border-radius: 6px; margin-bottom: 12px; font-size: 13px;
         border: 1px solid #fca5a5; }

/* password change */
.c-pw { max-width: 480px; margin: 0 auto; }
.c-pw label { display: block; font-size: 12px; font-weight: 600;
              margin-top: 12px; margin-bottom: 4px; }
.c-pw input { width: 100%; box-sizing: border-box; padding: 9px 12px;
              border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.c-pw button { margin-top: 16px; padding: 10px 22px; background: #0284c7;
               color: #fff; border: none; border-radius: 8px;
               font-size: 14px; font-weight: 600; cursor: pointer; }
.c-pw button:hover { background: #0369a1; }

/* ===== モバイル / PWA standalone 最適化 ===== */
@media (max-width: 640px) {
  /* iOS はフォーカス時に 16px 未満の入力を自動ズームしてレイアウトが飛ぶ → 16px に */
  input, select, textarea,
  .c-card input, .c-pw input { font-size: 16px; }
  /* 主要ボタン・小ボタンのタップ領域を確保 */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .topbar .logout button.link { min-height: 44px; padding: 0 4px; }
  /* 横長テーブルは画面全体ではなく表内で横スクロール（standalone で“アプリごと横に動く”のを防ぐ） */
  table.grid { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .c-auth { margin-top: 40px; }
}
