/* =============================================================================
   採用分析 ページ専用スタイル (ap- プレフィックスで console.css と非干渉)
   ============================================================================= */

.ap-loading, .ap-empty { text-align:center; color:#9CA3AF; padding:40px 16px; font-size:13px; }

/* ---------- KPI 行 ---------- */
.ap-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:18px; }
@media (max-width:720px) { .ap-kpis { grid-template-columns:repeat(2,1fr); } }
.ap-kpi { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:14px 16px; }
.ap-kpi__label { font-size:11px; color:var(--ink-mute); margin-bottom:4px; }
.ap-kpi__value { font-size:26px; font-weight:800; line-height:1.05; }
.ap-kpi__value small { font-size:12px; font-weight:600; color:var(--ink-soft); margin-left:2px; }
.ap-kpi__sub { font-size:11px; color:var(--ink-soft); margin-top:3px; }

/* ---------- 2カラム ---------- */
.ap-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:18px; }
@media (max-width:860px) { .ap-grid2 { grid-template-columns:1fr; } }
.ap-card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:18px 20px; }
.ap-card__title { font-size:14px; font-weight:800; margin:0 0 14px; }

/* ---------- 選考ファネル ---------- */
.ap-funnel { display:flex; flex-direction:column; gap:8px; }
.ap-fn-row { display:grid; grid-template-columns:84px 1fr 92px; align-items:center; gap:10px; }
.ap-fn-row__label { font-size:12px; font-weight:700; color:var(--ink-mute); }
.ap-fn-row__track { height:24px; background:var(--bg); border-radius:6px; overflow:hidden; }
.ap-fn-row__bar { height:100%; background:linear-gradient(90deg,var(--brand),#52B788); border-radius:6px;
    display:flex; align-items:center; padding:0 8px; color:#fff; font-size:11px; font-weight:700; min-width:2px; }
.ap-fn-row__meta { font-size:11px; color:var(--ink-soft); text-align:right; }
.ap-fn-row__meta b { color:var(--ink); font-size:13px; }

/* ---------- 媒体別 ---------- */
.ap-media { display:flex; flex-direction:column; gap:9px; }
.ap-media-row { display:grid; grid-template-columns:1fr 60px; align-items:center; gap:10px; }
.ap-media-row__name { font-size:12px; font-weight:600; }
.ap-media-row__track { height:7px; background:var(--bg); border-radius:999px; overflow:hidden; margin-top:4px; }
.ap-media-row__fill { height:100%; background:#2164F4; border-radius:999px; }
.ap-media-row__n { text-align:right; font-size:13px; font-weight:700; }
.ap-media-row__n small { font-size:11px; font-weight:500; color:var(--ink-soft); }

/* ---------- 応募者一覧 ---------- */
.ap-list-card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:6px 8px; }
.ap-table { width:100%; border-collapse:collapse; }
.ap-table th { font-size:11px; color:var(--ink-mute); text-align:left; padding:10px 10px 8px; border-bottom:1px solid var(--border); white-space:nowrap; }
.ap-table td { font-size:13px; padding:10px; border-bottom:1px solid #F3F4F6; }
.ap-table tr:last-child td { border-bottom:none; }
.ap-table tbody tr { cursor:pointer; }
.ap-table tbody tr:hover { background:#FAFBFC; }
.ap-id { font-family:'Inter',monospace; font-size:12px; color:var(--ink-soft); }

.ap-badge { display:inline-block; font-size:11px; font-weight:700; padding:2px 9px; border-radius:999px; white-space:nowrap; }
.ap-fit { display:inline-flex; width:22px; height:22px; align-items:center; justify-content:center;
    border-radius:6px; font-size:12px; font-weight:800; }

.ap-sec-title { font-size:14px; font-weight:800; margin:18px 0 10px; }

/* ---------- ドロワー ---------- */
.ap-overlay { position:fixed; inset:0; background:rgba(17,24,39,.4); z-index:60;
    opacity:0; pointer-events:none; transition:opacity .2s; }
.ap-overlay.is-open { opacity:1; pointer-events:auto; }
.ap-drawer { position:fixed; top:0; right:0; bottom:0; width:520px; max-width:94vw;
    background:var(--card); z-index:61; display:flex; flex-direction:column;
    box-shadow:-8px 0 28px rgba(0,0,0,.16); transform:translateX(100%); transition:transform .22s ease; }
.ap-drawer.is-open { transform:translateX(0); }
.ap-drawer__head { display:flex; align-items:center; justify-content:space-between;
    padding:16px 20px; border-bottom:1px solid var(--border); flex-shrink:0; }
.ap-drawer__title { font-size:16px; font-weight:800; margin:0; }
.ap-drawer__close { width:30px; height:30px; border:none; background:var(--bg); border-radius:8px;
    cursor:pointer; font-size:14px; color:var(--ink-mute); }
.ap-drawer__close:hover { background:var(--border); color:var(--ink); }
.ap-drawer__body { flex:1; overflow-y:auto; padding:18px 20px; }
.ap-drawer__foot { display:flex; align-items:center; gap:8px; padding:12px 20px;
    border-top:1px solid var(--border); flex-shrink:0; }

.ap-f { margin-bottom:13px; }
.ap-f--full { width:100%; }
.ap-f__label { display:block; font-size:12px; font-weight:700; color:var(--ink-mute); margin-bottom:4px; }
.ap-f__input, .ap-f__select, .ap-f__textarea {
    width:100%; padding:8px 10px; border:1px solid var(--border); border-radius:8px;
    font-size:13px; font-family:inherit; background:var(--card); outline:none; }
.ap-f__input:focus, .ap-f__select:focus, .ap-f__textarea:focus {
    border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
.ap-f__textarea { resize:vertical; min-height:56px; }
.ap-f-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ap-sec { margin:18px 0 4px; padding-top:14px; border-top:1px dashed var(--border); }
.ap-sec--first { margin-top:6px; padding-top:0; border-top:none; }
.ap-sec__h { font-size:12px; font-weight:800; margin-bottom:10px; }

/* ---------- ドロワー: セクションタブ ---------- */
.ap-drawer__tabs { display:flex; flex-shrink:0; border-bottom:1px solid var(--border);
    background:var(--card); }
.ap-tab { flex:1; padding:11px 6px; border:none; background:none; cursor:pointer;
    font-size:12px; font-weight:700; font-family:inherit; color:var(--ink-soft);
    border-bottom:2px solid transparent; transition:color .12s, border-color .12s; }
.ap-tab:hover { color:var(--ink); }
.ap-tab.is-active { color:var(--brand); border-bottom-color:var(--brand); }

/* ---------- ドロワー: 入力ヒント ---------- */
.ap-hint { background:var(--brand-soft); border-radius:9px; padding:10px 12px;
    font-size:11.5px; line-height:1.6; color:var(--ink-mute); margin-bottom:16px; }
.ap-hint b { color:var(--ink); font-weight:700; }

/* ---------- ドロワー: タグピッカー ---------- */
.ap-tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; min-height:24px; }
.ap-tags__empty { font-size:12px; color:var(--ink-soft); padding:3px 0; }
.ap-chip { display:inline-flex; align-items:center; gap:5px; background:var(--brand-soft);
    color:var(--brand); font-size:12px; font-weight:600; padding:3px 5px 3px 10px; border-radius:999px; }
.ap-chip__x { border:none; background:none; cursor:pointer; color:inherit; opacity:.6;
    font-size:11px; line-height:1; padding:2px; }
.ap-chip__x:hover { opacity:1; }
.ap-tag-input { margin-bottom:8px; }
.ap-suggest { display:flex; flex-wrap:wrap; gap:5px; }
.ap-suggest__btn { border:1px dashed var(--border); background:var(--card); cursor:pointer;
    font-size:11px; color:var(--ink-soft); font-family:inherit; padding:3px 9px; border-radius:999px;
    transition:border-color .12s, color .12s, background .12s; }
.ap-suggest__btn:hover { border-color:var(--brand); color:var(--brand); background:var(--brand-soft); }

/* ---------- ドロワー: 適合度ピッカー ---------- */
.ap-fitpick { display:grid; grid-template-columns:repeat(5,1fr); gap:7px; }
.ap-fitpick__btn { display:flex; flex-direction:column; align-items:center; gap:3px;
    border:1px solid var(--border); background:var(--card); border-radius:9px; cursor:pointer;
    padding:9px 4px; font-family:inherit; transition:border-color .12s, background .12s; }
.ap-fitpick__btn b { font-size:16px; font-weight:800; color:var(--ink-mute); }
.ap-fitpick__btn span { font-size:9.5px; color:var(--ink-soft); text-align:center; line-height:1.3; }
.ap-fitpick__btn:hover { border-color:var(--fc); }
.ap-fitpick__btn.is-active { border-color:var(--fc); background:color-mix(in srgb,var(--fc) 12%,transparent); }
.ap-fitpick__btn.is-active b { color:var(--fc); }

/* ---------- ドロワー: ステータス履歴 ---------- */
.ap-hist { display:flex; flex-direction:column; gap:7px; }
.ap-hist__item { display:flex; align-items:center; justify-content:space-between; gap:8px;
    background:var(--bg); border-radius:8px; padding:8px 10px; }
.ap-hist__label { font-size:12.5px; font-weight:600; }
.ap-hist__date { font-size:10.5px; color:var(--ink-soft); margin-top:1px; }

/* ---------- ドロワー: 必須バッジ・注記・訴求軸 ---------- */
.ap-req { display:inline-block; background:#DC2626; color:#fff; font-size:9.5px;
    font-weight:700; border-radius:4px; padding:1px 6px; margin-left:5px; vertical-align:1px; }
.ap-f__note { font-size:10.5px; color:var(--ink-soft); margin-top:4px; line-height:1.5; }
.ap-axis { font-size:11.5px; font-weight:700; color:var(--brand);
    background:var(--brand-soft); border-radius:7px; padding:6px 10px; margin:-2px 0 7px; }
.ap-axis-warn { font-size:11.5px; font-weight:600; color:#C2410C;
    background:#FFF7ED; border:1px solid #FED7AA; border-radius:7px;
    padding:7px 10px; margin:-2px 0 13px; line-height:1.5; }
.ap-media-row__cpa { font-size:9.5px; color:var(--ink-soft); font-weight:500; margin-top:1px; }

/* ---------- マスタ管理モーダル ---------- */
.ap-modal { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%) scale(.97);
    width:560px; max-width:94vw; max-height:88vh; background:var(--card);
    border-radius:14px; z-index:61; display:flex; flex-direction:column;
    box-shadow:0 24px 60px rgba(0,0,0,.28); opacity:0; pointer-events:none;
    transition:opacity .18s ease, transform .18s ease; }
.ap-modal.is-open { opacity:1; pointer-events:auto; transform:translate(-50%,-50%) scale(1); }
.ap-modal__head { display:flex; align-items:center; justify-content:space-between;
    padding:15px 20px; border-bottom:1px solid var(--border); flex-shrink:0; }
.ap-modal__title { font-size:16px; font-weight:800; margin:0; }
.ap-modal__tabs { display:flex; flex-shrink:0; border-bottom:1px solid var(--border); }
.ap-modal__body { flex:1; overflow-y:auto; padding:18px 20px; }
.ap-modal__foot { display:flex; align-items:center; gap:8px; padding:12px 20px;
    border-top:1px solid var(--border); flex-shrink:0; }

/* マスタ一覧の行 */
.ap-mlist { display:flex; flex-direction:column; }
.ap-mrow { display:flex; align-items:center; gap:11px; padding:11px 12px;
    border:1px solid var(--border); border-radius:10px; cursor:pointer;
    transition:border-color .12s, background .12s; }
.ap-mrow + .ap-mrow { margin-top:8px; }
.ap-mrow:hover { border-color:var(--brand); background:var(--brand-soft); }
.ap-mrow__ic { width:34px; height:34px; flex-shrink:0; border-radius:9px;
    display:flex; align-items:center; justify-content:center; font-size:16px; }
.ap-mrow__main { flex:1; min-width:0; }
.ap-mrow__name { font-size:13.5px; font-weight:700; }
.ap-mrow__sub { font-size:11px; color:var(--ink-soft); margin-top:2px; }
.ap-mrow__arr { color:var(--ink-soft); font-size:18px; flex-shrink:0; }
.ap-axis-badge { display:inline-block; background:var(--brand); color:#fff;
    font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:5px; margin-bottom:5px; }

/* カラーパレット */
.ap-pal { display:flex; gap:8px; flex-wrap:wrap; }
.ap-pal__sw { width:30px; height:30px; border-radius:8px; cursor:pointer; padding:0;
    border:3px solid transparent; box-shadow:0 0 0 1px var(--border); }
.ap-pal__sw.is-active { border-color:#fff; box-shadow:0 0 0 2px var(--brand); }

/* マスタ編集のエラー表示 */
.ap-errbox { background:#FEF2F2; border:1px solid #FECACA; color:#B91C1C;
    font-size:12px; padding:9px 12px; border-radius:8px; margin-bottom:14px; }

/* ---------- スマホ (≤640px): ドロワー / マスタモーダルをフルスクリーン化 ---------- */
@media (max-width: 640px) {
    /* 応募者ドロワー: 横幅 520px → 100vw */
    .ap-drawer { width:100vw; max-width:100vw; box-shadow:none; }
    .ap-drawer__head { padding:12px 14px; }
    .ap-drawer__title { font-size:15px; }
    .ap-drawer__body { padding:14px 14px 20px; }
    .ap-drawer__foot { padding:10px 14px; gap:6px; }

    /* ドロワー内: 2カラム行は1カラムに、適合度ピッカーは指で取りやすく */
    .ap-f-row { grid-template-columns:1fr; gap:0; }
    .ap-fitpick { gap:6px; }
    .ap-fitpick__btn { padding:11px 4px; }
    .ap-fitpick__btn b { font-size:18px; }

    /* 媒体・求人マスタモーダル: 中央配置 → フルスクリーン化
       transform を打ち消し、scale アニメは opacity フェードに置き換える */
    .ap-modal { top:0; left:0; width:100vw; max-width:100vw;
        height:100vh; max-height:100vh; border-radius:0;
        transform:translate(0,0); transition:opacity .18s ease; }
    .ap-modal.is-open { transform:translate(0,0); }
    .ap-modal__head, .ap-modal__foot { padding:12px 14px; }
    .ap-modal__body { padding:14px; }

    /* 応募者一覧テーブル: 7カラムあるためカード化すると縦に長くなりすぎる。
       横スクロール式 (スワイプ) で 1行 1件の閲覧性を保つ。
       common 側の .table-scroll カード化規則は適用していない (.ap-list-card は別) */
    .ap-list-card { overflow-x:auto; -webkit-overflow-scrolling:touch; padding:4px; }
    .ap-table { min-width:600px; }
    .ap-table th { padding:9px 8px; }
    .ap-table td { padding:9px 8px; font-size:12.5px; }
}

/* =============================================================================
   ヘルプアシスタント "ガラ" — キーワード横の?ピン + 右下FAB + 用語解説パネル
   ============================================================================= */

/* キーワード横の小さな?ピン (用語の説明を呼び出す) */
.help-pin {
    display:inline-flex; align-items:center; justify-content:center;
    width:16px; height:16px; border-radius:50%;
    background:var(--brand-soft); color:var(--brand);
    font-size:10px; font-weight:800; font-family:'Inter',monospace;
    cursor:pointer; margin:0 0 0 6px; vertical-align:middle;
    transition:transform .18s, background .18s, color .18s;
    border:none; flex-shrink:0; line-height:1;
}
.help-pin:hover { background:var(--brand); color:#fff; transform:scale(1.2); }

/* 右下の検索FAB (ガラを呼び出すボタン) */
.gala-fab {
    position:fixed; right:24px; bottom:24px; z-index:70;
    width:56px; height:56px; border-radius:50%;
    background:var(--brand); color:#fff;
    font-size:24px; font-weight:800; font-family:'Inter',monospace;
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 8px 22px rgba(45,106,79,.34);
    cursor:pointer; border:3px solid #fff;
    transition:transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, opacity .25s;
}
.gala-fab:hover { transform:translateY(-3px) scale(1.08); box-shadow:0 14px 30px rgba(45,106,79,.42); }
.gala-fab.is-hidden { opacity:0; transform:scale(0); pointer-events:none; }
.gala-fab__pulse {
    position:absolute; inset:-4px; border-radius:50%;
    background:var(--brand);
    opacity:.35; animation:galaPulse 2.4s ease-out infinite;
    pointer-events:none; z-index:-1;
}
@keyframes galaPulse {
    0%   { transform:scale(1);   opacity:.4; }
    100% { transform:scale(1.7); opacity:0;  }
}

/* ガラ本体 (キャラ + 吹き出し) — 画面外から飛び出す */
.gala {
    position:fixed; right:24px; bottom:24px; z-index:90;
    display:flex; align-items:flex-end; gap:12px;
    transform:translateY(calc(100% + 80px));
    opacity:0; pointer-events:none;
    transition:transform .55s cubic-bezier(.34,1.56,.64,1), opacity .3s;
}
.gala.is-shown { transform:translateY(0); opacity:1; pointer-events:auto; }

.gala__char {
    flex-shrink:0; width:84px; height:84px;
    filter:drop-shadow(0 6px 12px rgba(0,0,0,.16));
    animation:galaBob 2.8s ease-in-out infinite;
    position:relative; z-index:1;
}
@keyframes galaBob {
    0%, 100% { transform:translateY(0)    rotate(-3deg); }
    50%      { transform:translateY(-5px) rotate(3deg); }
}

.gala__bubble {
    position:relative; background:#fff;
    border-radius:18px; padding:18px 22px;
    width:360px; max-width:calc(100vw - 140px);
    box-shadow:0 24px 60px rgba(0,0,0,.22);
    font-size:13px; line-height:1.75; color:var(--ink);
    margin-bottom:8px;
}
.gala__bubble::after {
    content:''; position:absolute;
    bottom:24px; right:-8px;
    width:16px; height:16px; background:#fff;
    transform:rotate(45deg);
    box-shadow:4px -4px 8px -4px rgba(0,0,0,.06);
}

.gala__close {
    position:absolute; top:12px; right:14px;
    width:26px; height:26px; border-radius:50%;
    background:var(--bg); color:var(--ink-mute);
    display:inline-flex; align-items:center; justify-content:center;
    font-size:12px; border:none; cursor:pointer;
    transition:all .18s;
}
.gala__close:hover { background:#FEE2E2; color:#B91C1C; transform:scale(1.1); }

.gala__title {
    font-size:14px; font-weight:700;
    color:var(--brand-dark);
    margin:0 36px 8px 0;
    display:flex; align-items:center; gap:6px;
}
.gala__body { color:var(--ink); animation:galaFade .32s ease; }
.gala__body strong { color:var(--brand-dark); font-weight:700; }
.gala__body code {
    background:var(--bg); padding:1px 6px; border-radius:4px;
    font-family:'Inter',monospace; font-size:12px; color:var(--brand);
}
@keyframes galaFade {
    from { opacity:0; transform:translateY(4px); }
    to   { opacity:1; transform:translateY(0); }
}

.gala__back {
    display:inline-flex; align-items:center; gap:4px;
    padding:4px 10px; border-radius:6px; margin-top:12px;
    background:var(--bg); color:var(--ink-mute);
    font-size:11px; font-weight:600; border:none;
    cursor:pointer; font-family:inherit;
    transition:all .18s;
}
.gala__back:hover { background:var(--brand-soft); color:var(--brand); }

/* 検索モード */
.gala__search-input {
    width:100%; padding:10px 14px;
    border-radius:10px; background:var(--bg);
    font-size:13px; margin-bottom:12px;
    border:2px solid transparent; outline:none;
    transition:all .18s; font-family:inherit;
}
.gala__search-input:focus {
    background:#fff; border-color:var(--brand);
    box-shadow:0 0 0 3px var(--brand-soft);
}

.gala__suggest {
    display:flex; flex-direction:column; gap:4px;
    max-height:280px; overflow-y:auto;
    margin:0 -4px; padding:0 4px;
}
.gala__suggest-item {
    display:flex; justify-content:space-between; align-items:center; gap:8px;
    padding:10px 12px; border-radius:8px;
    font-size:12px; font-weight:500;
    background:var(--bg); color:var(--ink);
    text-align:left; transition:all .15s;
    cursor:pointer; width:100%; border:none; font-family:inherit;
}
.gala__suggest-item:hover {
    background:var(--brand-soft); color:var(--brand-dark);
}
.gala__suggest-item__lbl { flex:1; min-width:0; }
.gala__suggest-item__arrow {
    color:var(--ink-soft); font-size:11px;
    transition:transform .15s;
}
.gala__suggest-item:hover .gala__suggest-item__arrow {
    color:var(--brand); transform:translateX(2px);
}
.gala__suggest-empty {
    padding:16px 8px; text-align:center;
    font-size:11px; color:var(--ink-soft);
}

/* スマホ: FAB と吹き出しを縮小 */
@media (max-width: 640px) {
    .gala-fab { right:16px; bottom:16px; }
    .gala { right:16px; bottom:16px; flex-direction:column-reverse; align-items:flex-end; }
    .gala__bubble::after { display:none; }
    .gala__char { width:64px; height:64px; }
}
