#fms-product-discovery .inside {
    margin: 0;
    padding: 0;
}

.fms-product-discovery-fields {
    padding: 16px 18px 18px;
}

.fms-product-discovery-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.fms-product-discovery-group {
    min-width: 0;
    max-height: 390px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: #fbfcfe;
}

.fms-product-discovery-group legend {
    padding: 0 6px;
    color: #17243a;
    font-size: 15px;
    font-weight: 700;
}

.fms-product-discovery-group > p {
    margin: 2px 5px 9px;
    color: #596779;
    font-size: 12px;
    line-height: 1.55;
}

.fms-product-discovery-check {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    min-height: 26px;
    padding: 3px 5px;
    border-radius: 4px;
}

.fms-product-discovery-check:hover {
    background: #eef4ff;
}

.fms-product-discovery-check.depth-0 {
    margin-top: 5px;
    font-weight: 700;
}

.fms-product-discovery-check.depth-1,
.fms-product-discovery-check.depth-2 {
    margin-left: 22px;
}

.fms-product-finder {
    margin: 28px 0 24px;
    padding: 20px;
    border: 1px solid #dce3ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(23, 36, 58, .06);
}

.fms-product-finder.fms-is-staged {
    display: none;
}

.fms-product-finder h2 {
    margin: 0 0 14px;
    font-size: 1.2em;
}

.fms-product-finder.is-collapsible {
    padding: 0;
}

.fms-product-finder.is-collapsible h2 {
    margin: 0;
}

.fms-product-finder-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 18px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #17243a;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.fms-product-finder-toggle:hover,
.fms-product-finder-toggle:focus-visible {
    background: #f4f7fb;
}

.fms-product-finder-toggle:focus-visible {
    outline: 2px solid #1f6fbd;
    outline-offset: 2px;
}

.fms-finder-toggle-icon {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin-left: 14px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
}

.fms-product-finder:not(.is-collapsed) .fms-finder-toggle-icon {
    transform: rotate(225deg) translate(-2px, -2px);
}

.fms-product-finder-body {
    padding-top: 2px;
}

.fms-product-finder.is-collapsible .fms-product-finder-body {
    padding: 2px 18px 18px;
}

.fms-product-finder-body[hidden] {
    display: none !important;
}

.fms-product-finder-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 16px;
}

.fms-product-finder-tabs button {
    min-height: 46px;
    padding: 8px 12px;
    border: 1px solid #b9c7d8;
    border-radius: 8px;
    background: #f6f8fb;
    color: #24364c;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.fms-product-finder-tabs button:hover,
.fms-product-finder-tabs button:focus-visible {
    border-color: #1f6fbd;
    color: #155a9b;
}

.fms-product-finder-tabs button.is-active {
    border-color: #1f6fbd;
    background: #1f6fbd;
    color: #fff;
}

.fms-finder-panel:not(.is-active) {
    display: none;
}

.fms-finder-term-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.fms-finder-term-list li {
    margin: 0 !important;
    padding: 0 !important;
}

.fms-finder-term-list a {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    min-height: 31px;
    padding: 4px 9px;
    border: 1px solid #d5dde8;
    border-radius: 7px;
    background: #f4f6f8;
    color: #26384e;
    text-decoration: none;
    font-size: .8em;
    line-height: 1.45;
}

.fms-finder-term-list .is-child a {
    background: #f4f6f8;
}

.fms-finder-term-list a:hover,
.fms-finder-term-list .is-current a {
    border-color: #1f6fbd;
    background: #edf6ff;
    color: #155a9b;
}

.fms-finder-term-list a span {
    min-width: 22px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #edf1f6;
    color: #5a687a;
    font-size: 11px;
    text-align: center;
}

.fms-product-finder .shop-list.top-menu {
    margin: 0 !important;
}

.fms-product-finder .horizontal-shop-list {
    margin: 0 !important;
}

/* Some legacy theme rules use display:flex/grid and override the HTML hidden rule. */
.horizontal-shop-list[hidden],
.shop-list.top-menu[hidden] {
    display: none !important;
}

.fms-maker-index { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 16px; }
.fms-maker-index button { padding:6px 12px; border:1px solid #cbd7e4; border-radius:5px; background:#f4f7fa; color:#234; cursor:pointer; font:inherit; }
.fms-maker-index button[aria-pressed="true"] { background:#176eb0; color:#fff; }
.fms-maker-index button:focus-visible { outline:2px solid #176eb0; outline-offset:2px; }
.fms-finder-term-list li[hidden] { display:none!important; }
.fms-maker-filter {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 0 12px;
    font-size: .86em;
    font-weight: 700;
}

.fms-maker-filter input {
    width: min(100%, 320px);
    min-height: 36px;
    padding: 5px 9px;
    border: 1px solid #b9c7d8;
    border-radius: 7px;
    background: #fff;
    font: inherit;
    font-weight: 400;
}

.fms-maker-filter-empty {
    margin: 10px 0 0;
    color: #5a687a;
}

.fms-finder-empty {
    margin: 0;
    padding: 12px;
    border-radius: 7px;
    background: #f7f9fc;
    color: #5a687a;
}

.fms-product-term-summary {
    margin: 28px 0 0;
    padding: 14px 16px;
    border: 1px solid #dce3ec;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 0.92em;
    line-height: 1.7;
}

.fms-product-term-summary__row {
    display: grid;
    grid-template-columns: 8.5em minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0;
    padding: 0;
}

.fms-product-term-summary__row + .fms-product-term-summary__row {
    margin-top: 8px;
}

.fms-product-term-summary__label {
    display: block;
    position: static;
    margin: 0;
    padding: 2px 0;
    color: #24364c;
    font-size: 0.95em;
    font-weight: 700;
    line-height: 1.7;
}

/* SWELLや既存CSSの見出し・強調用疑似要素を、この分類ラベルへ持ち込ませない。 */
.fms-product-term-summary__label::before,
.fms-product-term-summary__label::after {
    display: none !important;
    content: none !important;
}

.fms-product-term-summary__row .fms-product-term-summary__label::before {
    display: inline-block !important;
    width: 1.25em;
    margin-right: 6px;
    color: #2179bf;
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-size: 1em;
    font-weight: 900;
    line-height: inherit;
    text-align: center;
    vertical-align: baseline;
}
.fms-product-term-summary__row.is-target-crop .fms-product-term-summary__label::before { content: '\f4d8' !important; }
.fms-product-term-summary__row.is-usage-crop .fms-product-term-summary__label::before { content: '\f058' !important; }
.fms-product-term-summary__row.is-related-theme .fms-product-term-summary__label::before { content: '\f0eb' !important; }
.fms-product-usage-summary { margin-top: 10px; }

.fms-product-term-summary__terms {
    display: block;
    min-width: 0;
}

.fms-product-term-summary a {
    display: inline-block;
    margin: 0 6px 5px 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e9f3ff;
    color: #155a9b;
    font-size: 0.88em;
    line-height: 1.65;
    text-decoration: none;
}


/*
 * 商品詳細：課題タグは「関連製品・サービス」の見出し直下、
 * 5件のサムネイル一覧の直前へ表示する。
 */
.fms-related-theme-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 7px 2px 8px;
    padding: 0 0 0 1.5em;
    line-height: 1.5;
}

.fms-related-theme-tags a {
    display: inline-block;
    margin: 0;
    padding: 3px 9px;
    border: 0;
    border-radius: 5px;
    background: #e9f3ff;
    color: #155a9b;
    font-size: 0.80em;
    font-weight: 500;
    line-height: 1.55;
    text-decoration: none;
}

.fms-related-theme-tags a:hover,
.fms-related-theme-tags a:focus-visible {
    text-decoration: underline;
}

/* Snippet 332: preserve five-column desktop / two-column mobile presentation. */
#related_items::before { font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free'; content: '\f009'; margin-right: 5px; font-weight: 900; }
.ro-related-list { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 30px; list-style: none; padding: 0; }
.ro-related-item { width: calc(20% - 12px); box-sizing: border-box; }
.ro-related-item a { display: block; text-decoration: none; color: inherit; transition: opacity .3s; }
.ro-related-item a:hover { opacity: .7; }
.ro-related-thumb { width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 4px; background: #fff; border: 1px solid #dedede; box-sizing: border-box; margin-bottom: 8px; }
.ro-related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ro-related-title { font-size: .85em; font-weight: bold; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 768px) {
    .ro-related-list { justify-content: center; }
    .ro-related-item { width: calc(50% - 7.5px); }
}

@media (max-width: 782px) {
    .fms-product-discovery-columns {
        grid-template-columns: 1fr;
    }

    .fms-product-discovery-group {
        max-height: none;
    }

    .fms-product-finder {
        margin: 20px 0;
        padding: 14px;
    }

    .fms-product-finder-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fms-product-finder-tabs button {
        min-height: 42px;
    }

    .fms-finder-term-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fms-finder-term-list a {
        justify-content: space-between;
        width: 100%;
        height: 100%;
        border-radius: 7px;
    }

    .fms-maker-filter {
        display: block;
    }

    .fms-maker-filter span {
        display: block;
        margin-bottom: 5px;
    }

    .fms-product-term-summary__row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .fms-product-finder.is-collapsible .fms-product-finder-body {
        padding: 2px 14px 14px;
    }

    .fms-related-theme-tags {
        padding-left: 1.25em;
    }
}

@media (min-width: 783px) and (max-width: 1199px) {
    .fms-product-discovery-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .fms-finder-term-list {
        grid-template-columns: 1fr;
    }
}
