/* ========== 基本 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #a8e6cf 0%, #56c596 50%, #38b27a 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 10px 0 20px;
}
.container { max-width: 1600px; margin: 0 auto; padding: 0 8px; }

/* ========== 上部バー（更新日＋表示切替） ========== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.last-updated {
    background: rgba(255,255,255,0.9);
    color: #1f6f4a;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 999px;
}
.device-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    padding: 4px 6px;
}
.device-btn {
    background: none;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}
.device-btn:hover  { background: #e8f8f0; border-color: #56c596; }
.device-btn.active { background: #56c596; border-color: #38b27a; }
.device-label { font-size: 0.62rem; color: #333; display: block; margin-top: 2px; }

/* ========== タイトル ========== */
.hero {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 16px;
    padding: 44px 30px 40px;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    text-align: center;
    border-bottom: 6px solid #38b27a;
}
.hero::before, .hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: #e3f7ec;
    z-index: 0;
}
.hero::before { width: 220px; height: 220px; left: -70px; top: -90px; }
.hero::after  { width: 160px; height: 160px; right: -50px; bottom: -70px; background: #d3f2e2; }
.hero-title, .hero-sub { position: relative; z-index: 1; }
.hero-title {
    font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Meiryo', sans-serif;
    font-weight: 900;
    font-size: clamp(1.9rem, 4.6vw, 3.4rem);
    line-height: 1.25;
    letter-spacing: 0.06em;
    color: #1f6f4a;
}
.hero-title .marker {
    padding: 0 0.2em;
    background: linear-gradient(transparent 62%, #c6f0d8 62%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.hero-icon { display: inline-block; margin-right: 0.25em; transform: rotate(-12deg); }
.hero-sub {
    font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Meiryo', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #3c5a4b;
    margin-top: 18px;
    letter-spacing: 0.04em;
}
.hero-sub strong { color: #2e9a66; font-size: 1.35em; font-weight: 900; }
.sp-br { display: none; }

/* ========== 検索・フィルタ ========== */
.search-area {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.search-box { margin-bottom: 20px; }
#searchInput {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #56c596;
    border-radius: 8px;
    font-size: 16px;
}
#searchInput:focus { outline: none; border-color: #38b27a; box-shadow: 0 0 0 3px rgba(86,197,150,0.2); }

.filter-title { font-size: 1rem; color: #2e8b62; margin: 4px 0 8px; }

.pricing-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 18px;
    padding: 10px 12px;
    background: #f0faf5;
    border-radius: 8px;
}
.pricing-filters label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.95rem; }
.pricing-filters input { accent-color: #38b27a; width: 16px; height: 16px; }

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.filters label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
}
.filters label:hover { background: #e8f8f0; }
.filters input[type="checkbox"] { margin-right: 8px; width: 16px; height: 16px; accent-color: #38b27a; }
.filter-top10 { background: #fff7d6; font-weight: 700; }
.filter-top10:hover { background: #ffefad !important; }
.rank-badge {
    display: inline-block;
    background: #fff1b8;
    color: #8a6100;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    margin-bottom: 2px;
    white-space: nowrap;
}
.count { margin-left: 4px; color: #888; font-size: 0.85em; }

.reset-button {
    display: block;
    margin: 0 auto;
    padding: 10px 28px;
    background: #56c596;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.reset-button:hover { background: #38b27a; }

/* ========== 結果 ========== */
.results-area {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    overflow-x: auto;
}
.results-info { margin-bottom: 16px; color: #38b27a; font-weight: 600; font-size: 1.05rem; }

table { width: 100%; border-collapse: collapse; }
thead { background: linear-gradient(135deg, #56c596 0%, #38b27a 100%); color: white; }
th { padding: 14px 12px; text-align: center; font-weight: 600; }
td { padding: 12px; border-bottom: 1px solid #eee; vertical-align: top; }
tbody tr:hover { background: #f0faf5; }

.tool-name       { font-weight: 600; color: #222; }
.tool-company    { color: #555; font-size: 0.93rem; }
.tool-country    { color: #38b27a; font-weight: 600; white-space: nowrap; }
.tool-category   { color: #38b27a; font-size: 0.9rem; }
.tool-strengths  { color: #555; font-size: 0.9rem; }
.tool-free-limit { color: #666; font-size: 0.9rem; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    margin-bottom: 2px;
}
.badge-free     { background: #d9f5e6; color: #1e7a4c; }
.badge-freemium { background: #e6f1fb; color: #1f5f99; }
.badge-trial    { background: #fdeede; color: #a0521b; }

.tool-link a {
    color: white;
    background: #56c596;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}
.tool-link a:hover { background: #38b27a; }

.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable:hover  { background: rgba(255,255,255,0.2); }
.sortable.sorted { background: rgba(255,255,255,0.15); }
.sort-icon { font-size: 0.82rem; margin-left: 4px; }

.no-results { text-align: center; padding: 40px; color: #999; }
.data-note  { margin-top: 14px; font-size: 0.8rem; color: #888; }

footer { text-align: center; color: white; margin-top: 30px; padding: 16px; font-size: 0.9rem; }

:focus-visible { outline: 3px solid #2e8b62; outline-offset: 2px; }

/* ========== スマホ ========== */
body.view-mobile .container     { max-width: 100%; padding: 0 4px; }
body.view-mobile .hero          { padding: 24px 12px 22px; margin-bottom: 12px; }
body.view-mobile .hero-title    { font-size: 1.7rem; }
body.view-mobile .hero-sub      { font-size: 0.9rem; margin-top: 12px; }
body.view-mobile .sp-br         { display: inline; }
body.view-mobile .last-updated  { font-size: 0.75rem; padding: 6px 10px; }
body.view-mobile .device-btn    { padding: 3px 5px; font-size: 1rem; }
body.view-mobile .search-area   { padding: 14px; margin-bottom: 12px; border-radius: 8px; }
body.view-mobile #searchInput   { padding: 10px 12px; font-size: 14px; }
body.view-mobile .pricing-filters { flex-direction: column; gap: 6px; }
body.view-mobile .filters       { grid-template-columns: 1fr 1fr; gap: 6px; }
body.view-mobile .filters label { font-size: 0.8rem; padding: 4px 6px; }
body.view-mobile .reset-button  { width: 100%; }
body.view-mobile .results-area  { padding: 10px 6px; border-radius: 8px; }
body.view-mobile table          { font-size: 0.78rem; }
body.view-mobile th, body.view-mobile td { padding: 7px 5px; }
body.view-mobile .tool-link a   { padding: 4px 8px; font-size: 0.78rem; }
body.view-mobile .col-category,
body.view-mobile .col-company   { display: none; }

/* ========== タブレット ========== */
body.view-tablet .container   { max-width: 1024px; padding: 0 10px; }
body.view-tablet .hero-title  { font-size: 2.4rem; }
body.view-tablet .filters     { grid-template-columns: repeat(3, 1fr); }
body.view-tablet table        { font-size: 0.88rem; }
body.view-tablet th, body.view-tablet td { padding: 10px 8px; }

/* ========== 追加：絞り込みの並び ========== */
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.filter-group { background: #f0faf5; border-radius: 10px; padding: 10px 14px; }
.filter-group .filter-title { margin-top: 0; }
.radio-group { display: flex; flex-direction: column; gap: 4px; }
.radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.93rem; }
.radio-group input { accent-color: #38b27a; width: 16px; height: 16px; }

.action-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.action-buttons .reset-button { margin: 0; }
.share-button {
    padding: 10px 22px;
    background: white;
    color: #2e8b62;
    border: 2px solid #56c596;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.share-button:hover { background: #e8f8f0; }

/* ========== 注意書き ========== */
.notice { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 0.93rem; line-height: 1.7; }
.notice-warn { background: #fff4e5; border-left: 5px solid #e89b3c; color: #6b4410; }
.notice-info { background: #eaf3fb; border-left: 5px solid #4a90d9; color: #1d4466; }
.notice a { color: inherit; font-weight: 700; }

/* ========== 表の追加パーツ ========== */
.name-line { display: flex; align-items: center; gap: 4px; }
.name-link {
    background: none; border: none; padding: 0;
    font: inherit; font-weight: 700; color: #1f6f4a;
    cursor: pointer; text-align: left;
    text-decoration: underline; text-decoration-color: #b5e6cc; text-underline-offset: 3px;
}
.name-link:hover { color: #38b27a; text-decoration-color: #38b27a; }
.fav-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.25rem; line-height: 1; color: #c3c3c3; padding: 2px;
}
.fav-btn.on { color: #f2b705; }
.fav-btn:hover { color: #f2b705; }
.tool-jp { text-align: center; }
.jp-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.7em; height: 1.7em; border-radius: 50%;
    font-weight: 700; font-size: 0.9rem;
}
.jp-o { background: #d9f5e6; color: #1e7a4c; }
.jp-a { background: #fff3cc; color: #8a6100; }
.jp-x { background: #eeeeee; color: #777; }
.badge-nosign { background: #efe7fb; color: #5b3a94; }

/* ========== スマホ用カード ========== */
.card-list, .mobile-sort { display: none; }
.tool-card {
    border: 1px solid #dcefe5;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-head h3 { font-size: 1.05rem; margin: 2px 0; }
.card-meta { font-size: 0.8rem; color: #555; display: flex; align-items: center; gap: 4px; }
.card-badges { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.card-strengths { font-size: 0.85rem; color: #333; }
.card-limit { font-size: 0.8rem; color: #666; margin-top: 4px; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; }
.detail-btn, .open-btn {
    flex: 1; text-align: center; padding: 8px; border-radius: 8px;
    font-weight: 700; font-size: 0.88rem; cursor: pointer; text-decoration: none;
}
.detail-btn { background: white; color: #2e8b62; border: 2px solid #56c596; }
.open-btn { background: #56c596; color: white; border: 2px solid #56c596; }
.open-btn:hover { background: #38b27a; }
.mobile-sort { margin-bottom: 10px; font-size: 0.85rem; align-items: center; gap: 6px; }
.mobile-sort select { padding: 6px; border-radius: 6px; border: 1px solid #56c596; font-size: 0.85rem; }

body.view-mobile #resultsTable { display: none; }
body.view-mobile .card-list { display: block; }
body.view-mobile .mobile-sort { display: flex; }
body.view-mobile .filter-row { grid-template-columns: 1fr; gap: 8px; }
body.view-mobile .radio-group label { font-size: 0.85rem; }
body.view-mobile .action-buttons button { width: 100%; }

/* ========== 凡例・注意・報告 ========== */
.legend { margin-top: 16px; font-size: 0.8rem; color: #777; line-height: 1.8; }
.safety, .feedback {
    background: white; border-radius: 12px; padding: 20px 24px; margin-top: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}
.safety h2, .feedback h2 { font-size: 1.1rem; color: #1f6f4a; margin-bottom: 8px; }
.safety p, .feedback p { font-size: 0.93rem; line-height: 1.8; }
.feedback-button {
    display: inline-block; margin-top: 10px; padding: 10px 22px;
    background: #56c596; color: white; border-radius: 8px;
    text-decoration: none; font-weight: 700;
}
.feedback-button:hover { background: #38b27a; }

/* ========== 詳細ポップアップ ========== */
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 60, 40, 0.45); }
.modal-box {
    position: relative; background: white; border-radius: 16px;
    width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
    padding: 26px 24px 22px; box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.modal-box h2 { font-size: 1.5rem; color: #1f6f4a; margin: 4px 0; }
.modal-box h3 { font-size: 1rem; color: #1f6f4a; margin: 16px 0 6px; }
.modal-close {
    position: absolute; top: 10px; right: 12px;
    background: #f0faf5; border: none; border-radius: 50%;
    width: 34px; height: 34px; font-size: 1rem; cursor: pointer;
}
.detail-list { display: grid; grid-template-columns: 7em 1fr; gap: 6px 10px; margin-top: 12px; font-size: 0.93rem; }
.detail-list dt { color: #2e8b62; font-weight: 700; }
.detail-list dd { color: #333; }
.tips { padding-left: 1.2em; font-size: 0.9rem; line-height: 1.7; color: #444; }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.modal-actions .open-btn { flex: 1; }
.modal-actions .fav-btn { font-size: 1.8rem; }
body.modal-open { overflow: hidden; }

th.col-jp { white-space: nowrap; }
.cat-details summary { cursor: pointer; list-style: none; margin-bottom: 8px; }
.cat-details summary::-webkit-details-marker { display: none; }
.cat-details summary::before { content: "▼ "; font-size: 0.8em; }
.cat-details:not([open]) summary::before { content: "▶ "; }
.cat-details:not([open]) summary::after { content: "（タップで開く）"; font-size: 0.8em; color: #888; font-weight: 400; }

/* ========== 上部右側（使用方法リンク＋表示切替） ========== */
.top-right { display: flex; align-items: center; gap: 10px; }
.howto-link {
    background: rgba(255,255,255,0.9);
    color: #1f6f4a;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}
.howto-link:hover { background: white; text-decoration: underline; }
body.view-mobile .top-bar { flex-wrap: wrap; }
body.view-mobile .top-right { gap: 6px; }
body.view-mobile .howto-link { font-size: 0.72rem; padding: 6px 9px; }

/* ========== 表：左4列を詰め、強みを広く ========== */
#resultsTable { table-layout: auto; }
#resultsTable th, #resultsTable td { padding: 10px 8px; }
#resultsTable th:nth-child(-n+4), #resultsTable td:nth-child(-n+4) { padding-left: 6px; padding-right: 6px; }
#resultsTable td:first-child, #resultsTable th:first-child { padding-left: 10px; }
.tool-name { min-width: 8.5em; max-width: 12em; }
.tool-company { min-width: 5em; max-width: 9em; }
.tool-country { min-width: 3.5em; }
.tool-jp, th.col-jp { width: 3.2em; text-align: center; }
.tool-strengths { min-width: 20em; }
.tool-free-limit { min-width: 10em; max-width: 15em; }
.tool-link { width: 5.5em; }

.strength-list { list-style: none; padding: 0; margin: 0; }
.strength-list li { position: relative; padding-left: 0.95em; line-height: 1.55; }
.strength-list li::before {
    content: "";
    position: absolute; left: 0.1em; top: 0.62em;
    width: 0.4em; height: 0.4em; border-radius: 50%;
    background: #56c596;
}
.card-strengths { font-size: 0.85rem; color: #333; margin-top: 4px; }
.detail-list .strength-list li { margin-bottom: 2px; }

/* ========== 使用方法 ========== */
.howto {
    background: white; border-radius: 12px; padding: 24px 26px; margin-top: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    scroll-margin-top: 16px;
}
.howto > h2 {
    font-family: 'Zen Maru Gothic', 'Meiryo', sans-serif;
    font-size: 1.5rem; color: #1f6f4a; margin-bottom: 14px;
}
.howto-steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: 14px; }
.howto-steps li {
    counter-increment: step;
    position: relative;
    padding: 12px 14px 12px 56px;
    background: #f0faf5;
    border-radius: 10px;
}
.howto-steps li::before {
    content: counter(step);
    position: absolute; left: 14px; top: 12px;
    width: 30px; height: 30px; border-radius: 50%;
    background: #38b27a; color: white;
    font-weight: 900; display: flex; align-items: center; justify-content: center;
}
.howto-steps h3 { font-size: 1.02rem; color: #1f6f4a; margin-bottom: 4px; }
.howto-steps p { font-size: 0.93rem; line-height: 1.8; color: #333; }
.howto-back {
    margin-top: 24px;
    text-align: center;
}
.howto-back a {
    display: inline-block;
    color: white;
    background: #38b27a;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 14px 36px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(56,178,122,0.35);
    transition: all 0.2s ease;
}
.howto-back a:hover {
    background: #2e9a66;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(56,178,122,0.45);
}
body.view-mobile .howto { padding: 18px 14px; }
body.view-mobile .howto-steps li { padding: 10px 10px 10px 48px; }
body.view-mobile .howto-steps li::before { left: 10px; width: 28px; height: 28px; }

/* 列幅を固定して、残りをすべて「強み」に回す */
#resultsTable { table-layout: fixed; width: 100%; }
#resultsTable th:nth-child(1) { width: 10em; }
#resultsTable th:nth-child(2) { width: 7.5em; }
#resultsTable th:nth-child(3) { width: 5.2em; }
#resultsTable th:nth-child(4) { width: 3.6em; }
#resultsTable th:nth-child(6) { width: 11.5em; }
#resultsTable th:nth-child(7) { width: 5.6em; }
.tool-name, .tool-company, .tool-country, .tool-strengths, .tool-free-limit { min-width: 0; max-width: none; overflow-wrap: anywhere; }
#resultsTable th .sort-icon { margin-left: 2px; }
#resultsTable th:nth-child(1) { width: 9.5em; }
#resultsTable th:nth-child(2) { width: 7em; }
#resultsTable th:nth-child(3) { width: 6em; }
#resultsTable th:nth-child(6) { width: 10.5em; }
.tool-country { font-size: 0.88rem; white-space: normal; }

/* ==========================================
   カテゴリ列：横幅が広いPC表示のときだけ表示
   ========================================== */
#resultsTable .col-category { display: none; }
#resultsTable th.col-strengths { width: auto; }
#resultsTable th.col-limit { width: 10.5em; }
#resultsTable th.col-link { width: 5.6em; }
@media (min-width: 1500px) {
    body.view-pc #resultsTable .col-category { display: table-cell; }
    body.view-pc #resultsTable th.col-category { width: 20em; }
    body.view-pc #resultsTable th.col-limit { width: 11em; }
    body.view-pc #resultsTable th.col-name { width: 9em; }
}
.cat-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.cat-tag {
    font-size: 0.72rem;
    line-height: 1.5;
    background: #f0faf5;
    color: #2e8b62;
    border: 1px solid #cdeedd;
    border-radius: 999px;
    padding: 0 6px;
    white-space: nowrap;
}

/* ==========================================
   開発企業・国・日本語・リンクを「強み」の2行目の高さにそろえる
   ========================================== */
#resultsTable td.tool-company,
#resultsTable td.tool-country,
#resultsTable td.tool-jp { padding-top: calc(10px + 1.35rem); }
#resultsTable td.tool-link { padding-top: calc(4px + 1.3rem); }

/* ==========================================
   目的の説明（① 選択時の説明 ／ ② 説明一覧）
   ========================================== */
.guide-btn {
    margin-left: 10px;
    padding: 3px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #2e8b62;
    background: white;
    border: 2px solid #56c596;
    border-radius: 999px;
    cursor: pointer;
    vertical-align: middle;
}
.guide-btn:hover { background: #e8f8f0; }

.category-info {
    background: #fffdf2;
    border-left: 5px solid #f2c94c;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.93rem;
    line-height: 1.7;
    color: #4a4020;
}
.cat-info-item { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; }
.cat-info-item + .cat-info-item { border-top: 1px dashed #eadca0; }
.cat-info-icon { font-size: 1.2rem; line-height: 1.5; }
.cat-info-item strong { color: #1f6f4a; }
.cat-info-hint { font-size: 0.85rem; color: #6b5a1c; }
.cat-info-more { margin-top: 6px; text-align: right; }
.link-btn {
    background: none; border: none; padding: 0;
    font: inherit; font-weight: 700; color: #2e8b62;
    text-decoration: underline; cursor: pointer;
}
.link-btn:hover { color: #1f6f4a; }

/* 説明一覧はポップアップを広めに */
.modal-box:has(.guide) { max-width: 780px; }
.guide h2 { margin-bottom: 6px; }
.guide-lead { font-size: 0.9rem; color: #555; margin-bottom: 4px; }
.guide-group {
    font-size: 1.05rem;
    color: #1f6f4a;
    margin: 20px 0 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid #c6f0d8;
}
.guide-item { background: #f7fcf9; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.guide-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.guide-item h4 { font-size: 0.98rem; color: #1f6f4a; }
.guide-item p { font-size: 0.88rem; line-height: 1.7; color: #333; margin-top: 4px; }
.guide-ex { color: #666 !important; font-size: 0.82rem !important; }
.guide-pick {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: white;
    background: #56c596;
    border: none;
    border-radius: 999px;
    cursor: pointer;
}
.guide-pick:hover { background: #38b27a; }
.guide-table-wrap { overflow-x: auto; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.guide-table th, .guide-table td { padding: 8px 10px; border-bottom: 1px solid #e3f2ea; text-align: left; vertical-align: top; }
.guide-table th { color: #1f6f4a; font-weight: 700; width: 45%; background: #f0faf5; }
body.view-mobile .guide-btn { display: block; margin: 6px 0 0; }
body.view-mobile .guide-table th { width: 40%; }

/* ==========================================
   「目的で絞り込む」の行の右端に出すAI利用の注意
   ========================================== */
.cat-details > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
}
.cat-details > summary::before { display: none; }
.summary-left::before { content: "▼ "; font-size: 0.8em; }
.cat-details:not([open]) .summary-left::before { content: "▶ "; }
.cat-details:not([open]) > summary::after { display: none; }
.ai-warning {
    color: #d32f2f;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    text-align: right;
    line-height: 1.5;
    margin-left: auto;
}
.ai-warning:hover { text-decoration: underline; }
body.view-mobile .ai-warning { text-align: left; font-size: 0.78rem; margin-left: 0; }

/* 下部の注意セクション */
.safety { border: 2px solid #f3c2c2; scroll-margin-top: 16px; }
.safety h2 { color: #d32f2f !important; }
.safety-list { padding-left: 1.2em; font-size: 0.93rem; line-height: 1.8; }
.safety-list li { margin-bottom: 6px; }
.safety-list strong { color: #b71c1c; }

/* ==========================================
   使う端末（PC・スマホ）のバッジ
   ========================================== */
.pf-badge {
    display: inline-block;
    margin-top: 3px;
    padding: 0 7px;
    font-size: 0.72rem;
    line-height: 1.6;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}
.pf-both   { background: #eef6ff; color: #1f5f99; }
.pf-pc     { background: #f1f1f1; color: #555; }
.pf-mobile { background: #fdeefa; color: #8a2a78; }
.card-meta .pf-badge { margin-top: 0; }
.tool-name .pf-badge { white-space: normal; max-width: 100%; }

/* ==========================================
   読み上げソフト・キーボード操作・見やすさへの対応
   ========================================== */
/* 画面には見せず、読み上げだけする文字 */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* Tabキーで最初に出る「検索結果へ移動」 */
.skip-link {
    position: absolute;
    left: 12px; top: -60px;
    z-index: 3000;
    background: #1f6f4a; color: #fff;
    padding: 10px 18px; border-radius: 8px;
    font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* どこを操作しているか、はっきり見えるように */
:focus-visible { outline: 3px solid #1f5f99 !important; outline-offset: 2px; }
.results-area:focus { outline: none; }

/* 表の見出しの並び替えボタン */
.sort-btn {
    background: none; border: none; color: inherit;
    font: inherit; font-weight: 600; cursor: pointer;
    padding: 2px 4px; border-radius: 4px;
}
.sort-btn:hover { text-decoration: underline; }

/* ---- 文字と背景の差をはっきりさせる（読みやすさの基準 4.5 以上） ---- */
header h1, .hero-title { color: #1f6f4a; }
.results-info, .tool-country, .tool-category,
.filter-title, .results-info p { color: #1f7a4f; }
.count, .card-limit, .legend, .guide-ex, .cat-info-hint { color: #595959 !important; }
.cat-tag { color: #1f6f4a; }
#searchInput::placeholder { color: #6b6b6b; }
.hero-sub strong { color: #1f7a4f; }
thead { background: linear-gradient(135deg, #237a52 0%, #1f6f4a 100%); }
.reset-button, .tool-link a, .open-btn, .feedback-button, .guide-pick,
.device-btn.active, .howto-back a, .howto-steps li::before {
    background: #237a52 !important;
}
.reset-button:hover, .tool-link a:hover, .open-btn:hover, .feedback-button:hover,
.guide-pick:hover, .howto-back a:hover { background: #1b5e40 !important; }
.device-btn.active .device-label { color: #fff; }
.detail-btn, .share-button, .guide-btn { color: #1f6f4a; border-color: #237a52; }
.name-link { color: #1f6f4a; text-decoration-color: #7cc4a0; }
.fav-btn { color: #8a8a8a; min-width: 32px; min-height: 32px; }
.fav-btn.on { color: #b8860b; }
.badge-free { color: #155d38; }
.ai-warning { color: #c62828; }

/* 動きを減らす設定にしている人には、アニメーションを止める */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
/* 読み上げで飛ばす絵文字の後ろにすき間を確保 */
.filters label > span[aria-hidden="true"],
.radio-group label > span[aria-hidden="true"] { margin-right: 0.3em; }

/* ==========================================
   言語の切り替え（日本語 / English）
   ========================================== */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255,255,255,0.92);
    border-radius: 999px;
    padding: 3px 4px 3px 10px;
}
.lang-icon { font-size: 1rem; margin-right: 4px; }
.lang-btn {
    background: none;
    border: none;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1f6f4a;
    cursor: pointer;
}
.lang-btn:hover { background: #e8f8f0; }
.lang-btn.active { background: #237a52; color: #fff; }
body.view-mobile .lang-switch { padding: 2px 3px 2px 6px; }
body.view-mobile .lang-btn { padding: 4px 8px; font-size: 0.75rem; }
body.view-mobile .lang-icon { display: none; }
.lang-btn { white-space: nowrap; }
body.view-mobile .top-right { flex-wrap: wrap; justify-content: flex-end; }
