/* ═══ SASHITE 本体の CSS（tehai-app.css を同じフォルダの 8 枚に分けたうちの 5/8・工程2 CSS・2026-09-28）═══
   空き状況モーダル（PC・スマホ）
   ★中身は tehai-app.css の 2456〜2719 行目を **そのまま** 移したもの（1 文字も変えていない）。
   ★順番が大事（カスケード）：functions.php が 00 → 07 の順に読む（deps で固定）。@import はしない。モックも同じ順（tehai/tests/harness/render_*.php）。
   ★1 枚でも欠けると functions.php は旧 tehai-app.css（1 枚）に戻して読む（fallback）。旧ファイルは 1 週間置いてから、fallback の行と一緒に消す。 ═══ */
/* ── ここから本文（tehai-app.css の 2456〜2719 行目・移しただけ）── */
/* ── 空き状況モーダル（スクショ特化レイアウト） ── */
.avail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,20,40,0.62);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8000;
    padding: 16px;
}

.avail-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 16px 56px rgba(0,0,0,0.32), 0 2px 8px rgba(0,0,0,0.10);
    width: fit-content;
    min-width: 400px;
    max-width: 96vw;
    padding: 0 0 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* カードトップ帯 */
.avail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(120deg, #1e3a5f 0%, #2c6fad 60%, #3a8bd4 100%);
    padding: 16px 22px 14px;
    margin-bottom: 16px;
}
.avail-header-left { display: flex; align-items: baseline; gap: 14px; }
.avail-title { margin: 0; font-size: 16px; font-weight: 800; color: #fff; letter-spacing: 0.06em; }
.avail-date  { font-size: 12px; color: rgba(255,255,255,0.75); font-weight: 500; }

.avail-close {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s;
}
.avail-close:hover { background: rgba(255,255,255,0.32); }

/* 枠ごとの列を横に並べる（既定の3枠なら今までどおり3列） */
.avail-body {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #e2e8f2;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 18px;
}
/* ★枠が4つ以上あると、右の枠が枠外へ出て見えなくなる（2026-09-12）。
   幅を詰めるより、横に動かせるようにするほうが名前が読める。 */
.avail-body.is-many {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.avail-body.is-many .avail-col { flex: 0 0 clamp(120px, 26%, 180px); }

/* 各シフト列 */
.avail-col {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    border-right: 1.5px solid #e2e8f2;
    background: #fafbfd;
}
.avail-col:last-child { border-right: none; }

/* シフトヘッダー */
.avail-col-header {
    padding: 8px 12px;
    min-width: calc(110px + 12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.avail-col-header-label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.1em;
}
.avail-col-header-badge {
    font-size: 11px;
    font-weight: 600;
    background: rgba(255,255,255,0.22);
    border-radius: 10px;
    padding: 2px 8px;
    letter-spacing: 0.03em;
}

/* スタッフ一覧エリア */
.avail-col-body {
    padding: 6px;
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: flex-start;
    min-height: 50px;
    background: #fff;
}

.avail-subcol {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* スタッフ pills — staff-item と同じ見た目 */
.avail-pill {
    width: 110px;
    margin-bottom: 4px;
    display: block;
    max-width: 110px;
    height: 25px;
    padding: 2px 5px;
    border-radius: var(--name-radius, 5px);   /* 出勤スタッフの札と同じ角丸（2026-09-12 統一） */
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avail-pill.avail-free {
    background: var(--col-color, #1e90ff);
    box-shadow: 0 2px 6px var(--col-shadow, rgba(30,144,255,0.28));
}
.avail-pill.avail-busy {
    background: #888;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.35), inset 0 1px 2px rgba(0,0,0,0.2);
}
/* 名前は左寄せ・色チップは右（一覧の札 .staffList-Container li と同じ寄せ方。2026-09-26） */
.avail-pill { justify-content: flex-start; text-align: left; gap: 4px; box-sizing: border-box; padding: 2px var(--chip-edge, 4px) 2px var(--name-pad-x, 5px); text-overflow: clip; }
.avail-pill-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avail-pill > .staff-marks { margin-left: auto; }
.avail-pill.avail-busy .staff-marks     { background: #f2f4f7; }   /* 割当済みの札（.staff-item.assigned）と同じ色の抜き方 */
.avail-pill.avail-busy .staff-marks i     { background: #6b7381; }
.avail-pill.avail-busy .staff-marks i.off { background: #d5dae1; }

/* 凡例 */
.avail-legend {
    display: flex;
    gap: 20px;
    margin: 12px 20px 0;
    padding-top: 10px;
    border-top: 1px solid #eef0f5;
    font-size: 11.5px;
    color: #888;
}
.avail-legend-item { display: flex; align-items: center; gap: 6px; }
.avail-legend-item::before {
    content: '';
    width: 12px; height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}
.avail-legend-free::before { background: #2c6fad; }
.avail-legend-busy::before { background: #d0d0d4; }

/* ── 空き状況モーダル スマホ対応 ── */
@media (max-width: 660px) {
    /* ボタン */
    .avail-btn-pc { display: none; }
    .avail-btn-sp { display: inline; font-size: 11px; text-align: center; }
    .avail-show-btn {
        padding: 4px 10px;
        font-size: 11px;
        min-width: 38px;
    }

    /* モーダル全体。
       ★2026-09-11 修正：カードを overflow-y:auto にしていたが、中の .avail-body が overflow:hidden の
         flex子要素なので「最小の高さ0まで縮んでよい」扱いになり、中身が押しつぶされて切れていた
         （カード自身ははみ出していないのでスクロールもできない＝全体が見えない）。
         見出しと凡例は固定し、一覧（.avail-body）だけを中でスクロールさせる形にする。 */
    .avail-card {
        max-height: 88vh;
        max-height: 88svh;
        overflow: hidden;
        width: 100%;
        min-width: 0;
        border-radius: 14px;
    }
    .avail-header { margin-bottom: 10px; padding: 12px 16px 10px; }
    .avail-header-left { flex-direction: column; align-items: flex-start; gap: 2px; }
    .avail-title { font-size: 15px; white-space: nowrap; }

    /* 3列→縦積み。ここだけをスクロールさせる */
    .avail-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex-direction: column;
        border-left: none;
        border-right: none;
        border-radius: 0;
        margin: 0 12px;
    }
    .avail-col { flex: 0 0 auto; }
    .avail-legend { margin-top: 10px; padding-top: 8px; gap: 14px; }
    .avail-col {
        border-right: none;
        border-bottom: 1.5px solid #e2e8f2;
    }
    .avail-col:last-child { border-bottom: none; }

    /* シフトヘッダー */
    .avail-col-header {
        padding: 7px 12px;
        min-width: 0;
    }
    .avail-col-header-label { font-size: 13px; }

    /* スタッフエリア — 上段から横に 1 2 3 4 ／ 5 6 7 8 … と積み下げる（スマホだけ）。
       ★2026-09-11：列に分けず grid で流す。1枚の最小幅を70pxにして、入る幅なら4列、狭い端末なら3列に
         自動で変わる（375px なら4列・各約71px、320px なら3列）。札のデザインは出勤スタッフ一覧の札
         （tehai-sync.css のスマホ指定）と同じ：高さ32・13px・角丸は --name-radius・太字600 */
    .avail-col-body {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 6px;
        padding: 6px 8px;
    }
    .avail-subcol { display: contents; }   /* PC用の列分けが残っていても、そのまま流し込む */

    /* pill ＝ スマホの出勤スタッフの札と同じ見た目（幅は列に合わせて伸縮） */
    .avail-pill {
        width: auto;
        max-width: none;
        min-width: 0;
        height: 32px;
        padding: 0 5px;
        margin: 0;
        font-size: 13px;
        font-weight: 600;
        border-radius: var(--name-radius, 5px);
    }
    .avail-pill.avail-busy {
        color: rgba(255, 255, 255, 0.75);   /* 一覧の割当済（li.assigned）と同じ */
        transform: translateY(1px);
    }
}

