/* ============================================================
   COMPARE_2026_10_16 求人を比べる（ログイン不要）
   - 求人カードの「比べる」ボタン／求人詳細の「ほかの求人と比べる」
   - 画面の下の比べるトレイ（1件以上入っていると出る）
   - 比較ページ /jobs/compare/（スマホは2列ずつ横にめくる・見出しは上に貼りつく）
   ============================================================ */

/* ── 比べるボタン ── */
.cmp-btn { cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent; }
.cmp-btn:focus-visible { outline: 3px solid #1B7FE6; outline-offset: 2px; }
.cmp-btn-text--on, .cmp-ico-on { display: none; }
.cmp-btn.is-on .cmp-btn-text--on, .cmp-btn.is-on .cmp-ico-on { display: inline-flex; }
.cmp-btn.is-on .cmp-btn-text--off, .cmp-btn.is-on .cmp-ico-off { display: none; }

.cmp-btn--card {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    display: inline-flex; align-items: center; gap: 4px;
    height: 34px; padding: 0 12px 0 9px; border-radius: 999px;
    border: 1px solid #D5DAE0; background: rgba(255, 255, 255, 0.96); color: #1B7FE6;
    font-size: 13px; font-weight: 800; line-height: 1;
    box-shadow: 0 1px 4px rgba(15, 27, 51, 0.14);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cmp-btn--card::before { content: ""; position: absolute; inset: -6px -2px; } /* 押せる範囲を広げる */
.cmp-btn--card .lucide-icon, .cmp-btn--card svg { width: 16px; height: 16px; flex-shrink: 0; }
.cmp-btn--card:hover { border-color: #1B7FE6; }
.cmp-btn--card.is-on { background: #1B7FE6; border-color: #1B7FE6; color: #fff; }
/* 写真の無いカード: 右上の保存ボタンの左 */
.hv2-job:not(.hv2-job--photo) > .cmp-btn--card { top: 16px; left: auto; right: 62px; }
.hv2-job:not(.hv2-job--photo) .hv2-job-head { padding-right: 150px; }

.cmp-btn--detail {
    display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px;
    border: 2px solid #CFE0F3; background: var(--bg-primary, #fff); color: #16263B; font-weight: 800;
}
.cmp-btn--detail .lucide-icon, .cmp-btn--detail svg { width: 20px; height: 20px; color: #1B7FE6; }
.cmp-btn--detail:hover { border-color: #1B7FE6; }
.cmp-btn--detail.is-on { background: #EAF3FD; border-color: #1B7FE6; color: #125FB3; }

/* ── 下の比べるトレイ ── */
.cmp-tray {
    position: fixed; left: 0; right: 0; z-index: 85;
    bottom: calc(var(--cmp-tray-bottom, 0px) + env(safe-area-inset-bottom, 0px));
    background: #fff; border-top: 1px solid #DCE6F2;
    box-shadow: 0 -6px 20px rgba(15, 27, 51, 0.10);
    animation: cmpTrayIn 0.25s ease;
}
.cmp-tray[hidden] { display: none; }
@keyframes cmpTrayIn { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .cmp-tray { animation: none; } }
.cmp-tray-in { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.cmp-tray-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.cmp-tray-count { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #4A5B70; }
.cmp-tray-count b { font-size: 18px; color: #1B7FE6; margin-right: 1px; }
.cmp-tray-chips { flex: 1; min-width: 0; display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.cmp-tray-chips::-webkit-scrollbar { display: none; }
.cmp-tray-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 2px 0 10px; border: 1px solid #CFE0F3; border-radius: 999px; background: #F6FAFE; font-size: 12px; font-weight: 700; color: #16263B; }
.cmp-tray-chip-name { max-width: 11em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-tray-x { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #64748B; cursor: pointer; }
.cmp-tray-x:hover { background: #E6F1FD; color: #125FB3; }
.cmp-tray-go { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 16px 0 18px; border-radius: 12px; background: #1B7FE6; color: #fff; font-size: 15px; font-weight: 800; text-decoration: none; box-shadow: 0 4px 12px rgba(27, 127, 230, 0.3); }
.cmp-tray-go:hover { background: #125FB3; color: #fff; }
.cmp-tray-wait { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #64748B; }
body.has-cmp-tray { padding-bottom: 68px; }
@media (min-width: 769px) {
    .cmp-tray { left: 50%; right: auto; bottom: 20px; width: min(760px, calc(100vw - 32px)); transform: translateX(-50%); border: 1px solid #DCE6F2; border-radius: 16px; box-shadow: 0 12px 32px rgba(15, 27, 51, 0.18); animation: none; }
    .cmp-tray-in { padding: 10px 12px 10px 18px; }
    body.has-cmp-tray { padding-bottom: 96px; }
}

/* ── 比較ページ ── */
.cmp-page { padding: 8px 0 56px; }
.cmp-note { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: #4A5B70; }
.cmp-note .lucide-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; color: #1B7FE6; }
.cmp-tools-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px; }
.cmp-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #16263B; cursor: pointer; min-height: 44px; }
.cmp-toggle input { width: 18px; height: 18px; accent-color: #1B7FE6; }
.cmp-add-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 13px; font-weight: 800; color: #1B7FE6; text-decoration: none; }
.cmp-add-link .lucide-icon { width: 16px; height: 16px; }

/* 表: 列の幅（PC は均等・スマホは2列ずつ見えて横にめくる） */
.cmp-grid { display: grid; grid-template-columns: repeat(var(--cmp-n, 2), minmax(220px, 1fr)); }
.cmp-grid--1 { --cmp-n: 1; } .cmp-grid--2 { --cmp-n: 2; } .cmp-grid--3 { --cmp-n: 3; } .cmp-grid--4 { --cmp-n: 4; }
.cmp-head, .cmp-body { overflow-x: auto; scrollbar-width: none; }
.cmp-head::-webkit-scrollbar { display: none; }
.cmp-head {
    position: sticky; top: var(--header-h, 64px); z-index: 6;
    background: #fff; border: 1px solid #DCE6F2; border-bottom: 2px solid #1B7FE6; border-radius: 14px 14px 0 0;
}
.cmp-body { border: 1px solid #DCE6F2; border-top: 0; border-radius: 0 0 14px 14px; background: #fff; scrollbar-width: thin; }
.cmp-head-cell { position: relative; padding: 12px 40px 12px 14px; min-width: 0; }
.cmp-head-cell + .cmp-head-cell, .cmp-cell + .cmp-cell { border-left: 1px solid #E8EEF6; }
.cmp-head-co { display: block; font-size: 12px; font-weight: 700; color: #4A5B70; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-head-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: 14px; font-weight: 800; line-height: 1.45; color: #16263B; text-decoration: none; }
.cmp-head-title:hover { color: #1B7FE6; }
.cmp-remove { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #F1F5F9; color: #4A5B70; cursor: pointer; }
.cmp-remove::before { content: ""; position: absolute; inset: -6px; } /* 押せる範囲を44pxに */
.cmp-remove .lucide-icon { width: 16px; height: 16px; }
.cmp-remove:hover { background: #E6F1FD; color: #125FB3; }

.cmp-row { display: contents; }
.cmp-label { grid-column: 1 / -1; background: #F3F8FE; border-top: 1px solid #E3ECF7; }
.cmp-row:first-child .cmp-label { border-top: 0; }
.cmp-label-in { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 13px; font-weight: 800; color: #16263B; }
.cmp-label-in .lucide-icon { width: 15px; height: 15px; color: #1B7FE6; }
.cmp-cell { padding: 10px 14px 12px; min-width: 0; font-size: 14px; line-height: 1.55; color: #16263B; overflow-wrap: anywhere; }
.cmp-v { display: block; font-weight: 700; }
.cmp-cell--part .cmp-v { color: #475569; font-weight: 600; }
.cmp-cell--none .cmp-v { color: #94A3B8; font-weight: 500; }
.cmp-ev { display: block; margin-top: 4px; font-size: 12px; line-height: 1.55; color: #64748B; }
.cmp-v a { color: #1B7FE6; text-decoration: none; display: inline; }
.cmp-v a .lucide-icon { width: 13px; height: 13px; margin-left: 3px; vertical-align: -1px; }
.cmp-date { display: block; margin-top: 2px; font-size: 12px; color: #64748B; }
.cmp-go { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 44px; }
.cmp-go .lucide-icon { width: 16px; height: 16px; }
.cmp-row--actions .cmp-cell { padding-top: 12px; padding-bottom: 14px; }
.cmp-page.is-hide-empty .cmp-row--empty { display: none; }
.cmp-foot-note { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: #64748B; }

.cmp-empty { max-width: 520px; margin: 24px auto; padding: 32px 20px; text-align: center; border: 1px dashed #CFE0F3; border-radius: 16px; background: #F8FBFF; }
.cmp-empty-ico { width: 36px; height: 36px; color: #1B7FE6; }
.cmp-empty-title { margin: 10px 0 6px; font-size: 17px; font-weight: 800; color: #16263B; }
.cmp-empty-text { margin: 0 0 16px; font-size: 14px; line-height: 1.7; color: #4A5B70; }
.cmp-empty-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

@media (max-width: 768px) {
    /* スマホ: 2件までは画面に2列ぴったり、3件以上は3列目が少し覗いて「横にめくれる」と分かる幅 */
    .cmp-page .container { padding-left: 12px; padding-right: 12px; }
    .cmp-grid { grid-template-columns: repeat(var(--cmp-n, 2), calc((100vw - 26px) / 2)); }
    .cmp-grid--1 { grid-template-columns: calc(100vw - 26px); }
    .cmp-grid--3, .cmp-grid--4 { grid-template-columns: repeat(var(--cmp-n), calc((100vw - 26px) / 2.25)); }
    .cmp-body { scroll-snap-type: x mandatory; }
    .cmp-cell, .cmp-head-cell { scroll-snap-align: start; }
    .cmp-head-cell { padding: 10px 38px 10px 12px; }
    .cmp-head-title { font-size: 13px; }
    .cmp-cell { padding: 9px 12px 11px; font-size: 13.5px; }
    .cmp-label-in { padding: 7px 12px; }
    .cmp-tools-row { margin-bottom: 8px; }
    /* 原文はスマホでは1つ・3行まで（行が縦に長くなりすぎないように） */
    .cmp-ev + .cmp-ev { display: none; }
    .cmp-ev { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

/* 確認用の写し（全求人の列入り）: JS が ?j= の列に is-shown を付けるまで何も見せない */
.cmp-page.is-all [data-cmp-col]:not(.is-shown) { display: none; }
.cmp-none-msg { margin: 16px 0; padding: 16px; border: 1px dashed #CFE0F3; border-radius: 12px; background: #F8FBFF; font-size: 14px; font-weight: 700; color: #4A5B70; text-align: center; }

/* PHOTO_FAV_2026_10_16 比べるページ: 会社のアイコン・イメージ写真の行・保存ボタン・会社ページ／公式の採用ページへのリンク */
.cmp-head-co { display: flex; align-items: center; gap: 6px; }
.cmp-head-co-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-logo { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 5px; object-fit: contain; background: #fff; border: 1px solid #E8EEF6; }
.cmp-logo--ini { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; border: 0; }
.cmp-row--photo .cmp-cell--photo { position: relative; padding: 0; border-bottom: 1px solid #E3ECF7; }
.cmp-photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cmp-cell--photo .fav-btn--card { top: 8px; right: 8px; left: auto; width: 38px; height: 38px; }
.cmp-cell .fav-btn--detail { width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 10px; font-size: 14px; border-radius: 10px; }
.cmp-sub-link { display: flex; align-items: center; gap: 5px; min-height: 40px; margin-top: 4px; font-size: 13px; font-weight: 700; color: #1B7FE6; text-decoration: none; line-height: 1.4; }
.cmp-sub-link .lucide-icon { width: 15px; height: 15px; flex-shrink: 0; }
.cmp-sub-link:hover { text-decoration: underline; }
@media (max-width: 768px) {
    .cmp-photo { aspect-ratio: 4 / 3; }
    .cmp-cell .fav-btn--detail { font-size: 13px; }
}

/* STRENGTH_2026_10_16 採用ご担当者様へ: 強みの節の「比べる画面の見本」リンク */
.fc-strength-link { margin: 16px 0 0; text-align: center; }
.fc-strength-link a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 2px solid #1B7FE6; border-radius: 12px; color: #1B7FE6; font-weight: 800; text-decoration: none; }
.fc-strength-link a:hover { background: #EAF3FD; }
.fc-strength-link .lucide-icon { width: 18px; height: 18px; }
@media (max-width: 640px) {
    .fc-strength .features-grid { grid-template-columns: 1fr; gap: 10px; }
}

/* CMP_TRAY_LOGO_2026_10_19 比べるバーのチップ: 会社のロゴ（favicon）か頭文字の丸を名前の前に */
.cmp-tray-chip--lg { padding-left: 6px; gap: 6px; }
.cmp-tray-chip .cmp-tray-logo { width: 20px; height: 20px; }
.cmp-tray-chip .cmp-tray-logo.cmp-logo--ini { font-size: 11px; }
/* CMP_TRAY_LOGO_2026_10_19 頭文字の丸の色（.cmp-logo の白い地より強く）*/
.cmp-logo--ini.hv2-job-logo--c0 { background: #1B7FE6; } .cmp-logo--ini.hv2-job-logo--c1 { background: #14A38B; } .cmp-logo--ini.hv2-job-logo--c2 { background: #E39A1B; }
.cmp-logo--ini.hv2-job-logo--c3 { background: #7B61D9; } .cmp-logo--ini.hv2-job-logo--c4 { background: #D8546E; } .cmp-logo--ini.hv2-job-logo--c5 { background: #4A6A8A; }
