.include-keyword-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 36px;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f7f9;
}

.include-keyword-mode-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 36px;
    margin: 0;
    padding: 7px 8px;
    color: #5b6472;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.include-keyword-mode-option + .btn-check + .include-keyword-mode-option {
    border-left: 1px solid #d8dee6;
}

.btn-check:checked + .include-keyword-mode-option {
    color: #ffffff;
    background: #0f8a55;
}

.btn-check:focus-visible + .include-keyword-mode-option {
    outline: 2px solid #ff6f0f;
    outline-offset: -2px;
}

.search-condition-preview {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 2px 0 16px;
    padding: 10px 11px;
    border-left: 3px solid #ff6f0f;
    background: #f7f8fa;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.55;
}

.search-condition-preview-icon {
    flex: 0 0 auto;
    color: #ff6f0f;
    font-size: 14px;
}

.search-insight-panel {
    width: 100%;
    margin: 18px 0;
    padding: 18px 0;
    border-top: 2px solid #172033;
    border-bottom: 1px solid #d8dee6;
    background: #ffffff;
    color: #172033;
}

.search-insight-panel[hidden] {
    display: none;
}

.search-insight-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 0 16px 14px;
}

.search-insight-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 5px;
    font-size: 17px;
    font-weight: 700;
}

.search-insight-condition {
    margin: 0;
    color: #626b78;
    font-size: 13px;
    line-height: 1.55;
}

.search-insight-result {
    flex: 0 0 auto;
    min-width: 92px;
    text-align: right;
}

.search-insight-result strong {
    display: block;
    color: #0f8a55;
    font-size: 22px;
    line-height: 1.2;
}

.search-insight-result span {
    color: #7a8492;
    font-size: 12px;
}

.search-insight-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 16px 14px;
    padding: 11px 12px;
    border-left: 3px solid #e15454;
    background: #fff5f5;
    color: #8a2525;
    font-size: 13px;
    line-height: 1.5;
}

.search-insight-alert.warning {
    border-left-color: #d78900;
    background: #fff9eb;
    color: #72500c;
}

.search-funnel-list {
    display: grid;
    grid-template-columns: repeat(8, minmax(96px, 1fr));
    margin: 0;
    padding: 0 16px;
    overflow-x: auto;
    list-style: none;
}

.search-funnel-stage {
    position: relative;
    min-width: 96px;
    padding: 11px 10px;
    border-top: 1px solid #e1e5ea;
    border-bottom: 1px solid #e1e5ea;
    background: #fafbfc;
}

.search-funnel-stage + .search-funnel-stage {
    border-left: 1px solid #e1e5ea;
}

.search-funnel-stage.is-inactive {
    color: #9aa2ad;
    background: #ffffff;
}

.search-funnel-stage.is-zero {
    color: #9b2c2c;
    background: #fff0f0;
}

.search-funnel-label,
.search-funnel-detail,
.search-funnel-count,
.search-funnel-removed {
    display: block;
}

.search-funnel-label {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
}

.search-funnel-detail {
    min-height: 17px;
    color: #77808d;
    font-size: 10px;
    line-height: 1.3;
}

.search-funnel-count {
    margin-top: 4px;
    font-size: 17px;
    font-weight: 700;
}

.search-funnel-removed {
    color: #8b94a1;
    font-size: 10px;
}

.search-relaxation-wrap {
    margin: 15px 16px 0;
    padding-top: 14px;
    border-top: 1px solid #e1e5ea;
}

.search-relaxation-title {
    margin: 0 0 9px;
    font-size: 14px;
    font-weight: 700;
}

.search-relaxation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-relaxation-button,
.search-condition-restore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid #cbd2da;
    border-radius: 6px;
    background: #ffffff;
    color: #273142;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

.search-relaxation-button:hover {
    border-color: #ff6f0f;
    color: #d95300;
    background: #fff7f2;
}

.search-relaxation-count {
    color: #0f8a55;
    font-weight: 700;
}

.search-condition-restore {
    margin-top: 10px;
    border-color: #172033;
    color: #ffffff;
    background: #172033;
}

.search-condition-restore:hover {
    color: #ffffff;
    background: #2a3549;
}

@media (max-width: 768px) {
    .search-insight-panel {
        margin: 12px 0;
        padding: 14px 0;
    }

    .search-insight-head {
        gap: 10px;
        padding: 0 12px 12px;
    }

    .search-insight-title {
        font-size: 15px;
    }

    .search-insight-condition {
        font-size: 12px;
    }

    .search-insight-result {
        min-width: 70px;
    }

    .search-insight-result strong {
        font-size: 19px;
    }

    .search-insight-alert,
    .search-relaxation-wrap {
        margin-right: 12px;
        margin-left: 12px;
    }

    .search-funnel-list {
        grid-template-columns: repeat(8, 112px);
        padding: 0 12px 7px;
        scroll-snap-type: x proximity;
    }

    .search-funnel-stage {
        scroll-snap-align: start;
    }

    .search-relaxation-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .search-relaxation-button,
    .search-condition-restore {
        width: 100%;
    }
}
